I'm using the following code to prevent a page from caching a twig random()
command.
<?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');
?>
I am only using the random()
command on a single page, but the file that controls caching is global, is there away to target a specific file ie. default.html
? Instead of preventing caching for the entire site?