TitleIf-Modified-Since Header Support
Date15-Sep-2006 01:43:36 EEST
JSPWiki version
SubmitterMikolajR
Idea CategoryProviderIdea
Reference
Idea StatusNewIdea

I think that the Engine should support If-Modified-Since HTTP header. It should compare date in the header with page's last modification date. Resulting with short HTTP 302 response if there is nothing new. It would result in bandwith save (when search engines come to index site) and would enable more caching at proxy servers.


We do that already for RSS and attachments. However, for page content... What if there is dynamic information on the page? E.g. plugins that update their content on each retrieval? The cached page data would then be wrong.

-- JanneJalkanen


That makes things more complicated. So maybe there should be a kind meta information connected to the page whether it is 'static' or 'dynamic', or simply to enable/disable such header support.

-- MikolajR


The page properties could store information on whether plugins are used. If not, then the page would be known to be static (as most pages are). In the future, it might be worth allowing plugins to report whether they return static or dynamic content. eg: the java2Html plugin always returns static content, so it's ok to cache it's results.

The code is 304 Not Modified. 302 is a redirect.

To implement the change, the server should return a Last-Modified header which matches the datestamp of the current version, for all static content. This will let browsers and other clients know to send an If-Modified-Since header on future requests. If this header is present in the request, and the page is marked as static, the server should return 304.

-- NealeRudd


There is an additional problem that you would need to look at all the included page from both the markup as well as the template point of view: Also, putting a plugin in the LeftMenu would simply invalidate the whole 304 support. Or some other dynamic content like the username greeting (which is already there).

Note that we already have 304 support for RSS and attachments. In RSS we simply ignore the plugins (because the server load caused by an RSS reader is too much if we don't support if-modified-since and/or ETags), for attachments this is rather easy.

-- JanneJalkanen


Good point, I forgot about the greeting on the LeftMenu. It's wouldn't matter for search engines as the user isn't logged in, but would cause havoc with browsers, especially if more than one user is using the same machine.

--NealeRudd, 09-Oct-2006

Add new attachment

Only authorized users are allowed to upload new attachments.
« This page (revision-6) was last changed on 09-Oct-2006 13:53 by NealeRudd