TIP – Prevent js and css files from being cached

By default, external files such as javascript and css are cached by the browser. If you want to prevent this from caching, simply use this easy tip:

<link href="/stylesheet.css?<?php echo time(); ?>" rel="stylesheet" type="text/css" />

The result will look like this:

<link href="/stylesheet.css?1234567890" rel="stylesheet" type="text/css" />

Leave a Reply

Your email address will not be published. Required fields are marked *

*