Prevent Js and Css Files from Being Cached
Prevent Js and Css Files from Being Cached
Language:: PHP Type:: Back-end
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:
1.``<link href=``"/stylesheet.css?<?php echo time(); ?>" rel=``"stylesheet" type=``"text/css" /&glt;
The result will look like this:
1.``<link href=``"/stylesheet.css?1234567890" rel=``"stylesheet" type=``"text/css" /&glt;
Type::snippet Source: http://davidwalsh.name/prevent-cache