Take the 2-minute tour ×
Webmasters Stack Exchange is a question and answer site for pro webmasters. It's 100% free, no registration required.

I'm using an application that sets ETags by md5()ing the URL. As I understand it, that's quite insane. In effect, it means that content for a specific URL won't be fetched anew ... ever. Unless a hard-refresh is sent or, maybe, the browser is restarted (yet to test the latter).

Is this abuse of the ETag header?

share|improve this question
add comment

1 Answer 1

up vote 1 down vote accepted

Well, if the content never, ever changes, then I guess it would be OK. Otherwise... no.

Of course, browsers will still need to contact the server (using a conditional GET request) to determine whether the content has changed, so it's not quite as bad as, say, setting an Expires date too far in the future: as soon as you fix the application to use ETags correctly, the old URL-based ETags will no longer match and everything will work normally.

share|improve this answer
    
This is for dynamic content, assembled from files, and the database. It's a blanket policy for all URLs. This is quite a well known CMS, albeit not the latest version (but a version that is in widespread use) –  Bobby Jack Mar 1 '12 at 22:58
    
Well, I'd say it's broken, then. That's definitely not how ETags are supposed to be used. –  Ilmari Karonen Mar 1 '12 at 23:00
    
No, that's what I thought. I may be oversimplifying the code, and/or missing something, but my testing seems to confirm the dodgy behaviour, and the 'etag = md5(URL)' code is there for all to see. This is joomla 1.5, btw. –  Bobby Jack Mar 2 '12 at 8:06
    
Doesn't look like that's the only problem with Joomla's ETag handling, either. Anyway, I took a look at the code (both v1.5 and the latest version), and I agree that it seems to be broken as designed. Simply put, the Joomla cache ID is not suitable for use as an ETag, since it's tied to the URL of the page, not its content. You might want to report this as a bug. –  Ilmari Karonen Mar 2 '12 at 11:56
    
@BobbyJack: If you found this answer useful, could you please mark it as accepted (click on the check mark on the left). That way, the StackExchange software won't keep bumping the question to the front page. You might want to do the same for your other questions, too. Thanks! –  Ilmari Karonen May 30 '12 at 18:39
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.