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” />

Like it.? Share it:

Comments are closed.