Reliable file caching

inciongmte

New Member
I'm trying to determine the best way to cache my JavaScript and CSS files.There are several ways of doing this:[*]Using the \[code\]Date\[/code\], \[code\]Expires\[/code\] and \[code\]Cache-Control\[/code\] headers[*]Using the \[code\]ETag\[/code\] header[*]Cache forever and change the filename when the file changes[*]Append a querystring to the filename in the HTML with the last mod time or an MD5 of the file contentsI was under the impression that the last method (4) was the most reliable and would result in the fewest unnecessary requests, but my friend just told me that sometimes the querystring method is unreliable and you actually need to change the filename.Are there any downsides to setting the HTTP headers to cache forever and just using a query-string with the last mod time, or are there scenarios where another method would be more beneficial?
 
Back
Top