I have a page on a site which uses random()
twig, in Firefox and Chrome it is prevented from working because it gets cached as soon as the page loads.
Is there a way to turn off caching of a particular file via the Apache configs, lets call it default.html
or even better just turn off caching for the script part of that file but keep caching image files?
I have tried .htaccess
but this does not work.
The only way currently that allows the script to work is to turn off caching globally via PHP headers:
<?php
header('Expires: Mon, 26 Jul 1997 05:00:00 GMT');
header('Cache-Control: no-store, no-cache, must-revalidate');
header('Cache-Control: post-check=0, pre-check=0', FALSE);
header('Pragma: no-cache');
?>
But as I only need to turn off caching for an individual page, turning it off for everything seems crazy.