I personally prefer to use the latest file mtime.
Reading, combining and hashing your assets on every page load seems more
inefficient than just checking mtimes.
Or am I missing something?

Also a note on mod_pagespeed, we have started using it not too long ago, and
noticed 1 small issue that may catch you out.
By default it shortens URLs in HTML, but if you requesting only partial HTML
via Ajax, then it will sometimes break your links.
This is because it trys to convert absolute links to relative links.

David Neilsen | 07 834 3366 | PANmedia ®


On Sat, Aug 27, 2011 at 10:42 AM, Bob Brown <[email protected]> wrote:

> Plus one for the hash method. If you're frequently updating the entire
> application (we release ours as a source code checkout of a specific branch)
> then the modified times of the files are going to change as well.
>
> The hash method ensures that your users aren't going to needlessly
> re-download content if it hasn't actually changed.
>
> Depending on the load on your site it may be acceptable to reference a
> filename like so: styles.css?<?php echo md5file( 'style.css' ); ?>
>
> Cheers,
>
> - Bob -
>
>
> On 27/08/2011, at 9:30 AM, Michael Robinson <[email protected]>
> wrote:
>
>  One could append a hash as a GET parameter to the CSS file in the head -
> using a different hash when the CSS is updated. Or one could change the name
> of the CSS file whenever it is updated.
>
> Stack overflow has a good description of how one could achieve this in PHP:
>
>
> What is an elegant way to force browsers to reload cached CSS/JS 
> files<http://stackoverflow.com/questions/118884/what-is-an-elegant-way-to-force-browsers-to-reload-cached-css-js-files/118886#118886>
> ?
>
> Or one could use mod_pagespeed <https://code.google.com/p/modpagespeed/>,
> which can be configured to do this automagically.
>
> Mike
>
>  --
> NZ PHP Users Group: http://groups.google.com/group/nzphpug
> To post, send email to [email protected]
> To unsubscribe, send email to
> [email protected]
>

-- 
NZ PHP Users Group: http://groups.google.com/group/nzphpug
To post, send email to [email protected]
To unsubscribe, send email to
[email protected]

Reply via email to