Last modified: 2014-03-14 14:14:37 UTC
Currently MediaWiki checks the If-Modified-Since header and sends a 304 response if, indeed, the resource has not been modified since. However, no such check is done for ETags, even despite the fact that the ETag header can be enabled with the $wgUseETag configuration variable. MediaWiki should check the If-None-Match header and respond appropriately.
Related URL: https://gerrit.wikimedia.org/r/60440 (Gerrit Change I02d25e8bc6bd2231fb813f7c9f7118d8a7539b11)
I looked at this before, found my old patch and cleaned it up a tad, comments welcome. For reference: http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.26 http://www.w3.org/Protocols/rfc2616/rfc2616-sec13.html#sec13.3.3
What is the point in doing this? It's not required by the spec. Does it have some performance advantage?
Changing to enhancement. (In reply to comment #3) > What is the point in doing this? It's not required by the spec. Does it have > some performance advantage? Not AFAIK. Although one thing it does allow is multiple cached versions of the page, i.e., if the browser has multiple cached versions it can send the ETag of each one, and if any of them matches the server will respond with 304. If-Modified-Since doesn't support this since it is just given one date value.
(In reply to comment #4) > Changing to enhancement. > > (In reply to comment #3) > > What is the point in doing this? It's not required by the spec. Does it have > > some performance advantage? > > Not AFAIK. Although one thing it does allow is multiple cached versions of > the page, i.e., if the browser has multiple cached versions it can send the > ETag of each one, and if any of them matches the server will respond with 304. > If-Modified-Since doesn't support this since it is just given one date value. Is there any browser that does that?
(In reply to comment #5) > Is there any browser that does that? I don't know, but is there any harm in supporting it? I'm not saying this is high priority or anything, but nonetheless it's something we can do.
It's a fairly complex change to review. It's easy to imagine ways in which adding ETag support could break things. The code is difficult to test due to the lack of client support, and could easily be broken by future updates to caching semantics in other parts of MediaWiki. In exchange for time spent reviewing it, and the inevitable time which will be required to maintain it in the future, I would like there to be some kind of benefit.
Path abandoned: https://gerrit.wikimedia.org/r/#/c/60440/
Potential rationale in bug 32364