cache problem using link to parent page in alias pages

Permalink
I'm using a php include in all my pages to go back to the referring parent page. This works great until i switch on site-caching. All 'real pages' still do work, but when i use the button in an alias from a page in a different parent-page, the caching is a problem. I get directed to the 'real' parent-page.

Is there a way to avoid this problem when using cache on?

This is my include script:

<?php
$page = Page::getByID($c->getCollectionParentID());
$parent_url = View::URL($page->getCollectionPath());
?>
<?php
switch ($_SERVER['HTTP_REFERER']) {
case 'http://c5.hutspott.nl/';
echo '<p><strong><a href="/">GA TERUG</a></strong></p>';
break;
default:
echo '<p><strong><a href="';
echo "$parent_url";
echo '">GA TERUG</a></strong></p>';
break;
}
?>

buurvrouw
 
buurvrouw replied on at Permalink Reply
buurvrouw
No one here who can help me out on this?
buurvrouw replied on at Permalink Reply
buurvrouw
figured it out using a much simpler approach:

<a href="../">GA TERUG</a>