best practices on setting HTTP headers and status codes

Héctor Velarde <[email protected]>
Newsgroups gmane.comp.web.zope.plone.devel
Message-ID <[email protected]>
I'm working on the development of a package (collective.liveblog) that 
has a browser view that, potentially, can be hit by thousands of clients 
on a matter of a minute. this browser view returns some HTML used to 
update the default view of a content type using an AJAX call. the idea 
is not to update the whole default view, but just a small part of it, 
for performance and user experience reasons.

what I want is to return a 304 status code if the view has not changed 
since the last time the client got it. as I want to be a good citizen, I 
want to handle this with and without proxies (Varnish).

to solve this problem I'm handling the "If-Modified-Since" request 
header and, while working on that, I found some code in different parts 
of the Plone core code that handles similar situations; an example, for 
images, can be found here:

https://github.com/plone/plone.app.blob/blob/master/src/plone/app/blob/download.py#L5

we just had a hot debate on whether or not this should be implemented on 
the browser view.

my question: is having code handling this kind of situations considered 
a good practice or is best to leave this to plone.app.caching and friends?

best regards
-- 
Héctor Velarde

------------------------------------------------------------------------------
Want excitement?
Manually upgrade your production database.
When you want reliability, choose Perforce
Perforce version control. Predictably reliable.
http://pubads.g.doubleclick.net/gampad/clk?id=157508191&iu=/4140/ostg.clktrk

_______________________________________________
Plone-developers mailing list
Plone-developers-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org
https://lists.sourceforge.net/lists/listinfo/plone-developers
smime.p7s (application/pkcs7-signature, 3.7 KB) - not displayed
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.