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?


1 Answer 1


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.

  • 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
    Commented Mar 1, 2012 at 22:58
  • Well, I'd say it's broken, then. That's definitely not how ETags are supposed to be used. Commented Mar 1, 2012 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
    Commented Mar 2, 2012 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. Commented Mar 2, 2012 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! Commented May 30, 2012 at 18:39

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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