Preventing css or javascript caching

making css or javascript unique is important to bypass any caching mechanism, ie good for checking updates in production environment.

Some good technique involves appending a version number or timestamp after the filename. In wordpress, it is really easy

<link rel=”stylesheet” href=”<?php bloginfo(‘stylesheet_url’); ?>?<?php echo filemtime(TEMPLATEPATH.’/style.css’); ?>” type=”text/css” />

Author: bpeh

Bernard Peh is a great passioner of web technologies and one of the co-founder of Sitecritic.net Website Design and Reviews. He works with experienced web designers and developers everyday, developing and designing commercial websites. He specialises mainly in SEO and PHP programming.