Force CSS cache to refresh via file?

Hi there,

I have a CSS file that is included on every page of my website. Is there a way I can force this file to refresh it’s cache via the file itself? I have so many pages so it would be so time consuming to add a versioning attribute to the end of the include.

Any ideas?


It can be automated server side.


$csstime = date ("Y-m-d\TH-i", filemtime($_SERVER["DOCUMENT_ROOT"] . '/css/style.css'));


<link rel="stylesheet" type="text/css" href="css/style.css?update=<?php echo $csstime ?>">

This will cache, but refresh when changed.


This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.