pando.py icon indicating copy to clipboard operation
pando.py copied to clipboard

should set cache headers on static resources

Open chadwhitacre opened this issue 13 years ago • 9 comments

chadwhitacre avatar Dec 06 '12 16:12 chadwhitacre

specify this how? where? an outbound hook?

pjz avatar Dec 06 '12 20:12 pjz

StaticResource?

chadwhitacre avatar Dec 06 '12 20:12 chadwhitacre

This is my go-to for HTTP caching: http://www.mnot.net/cache_docs/

chadwhitacre avatar Dec 06 '12 20:12 chadwhitacre

So, there's options here:

  1. Add Last-Modified: headers on outbound responses, and respond to If-Modified-Since: headers with a 304 if appropriate

  2. Add ETags: headers on outbound responses and respond to If-None-Match: headers with a 304 if appropriate

  3. Both of the above.

Which did you have in mind? or, something else?

pjz avatar Dec 19 '12 02:12 pjz

@pjz Both. Don't you think?

chadwhitacre avatar Jan 16 '13 04:01 chadwhitacre

So in reading the link above, there's a library cgi_buffer that claims to handle this caching stuff automatically.

colindean avatar Mar 19 '13 14:03 colindean

Pull requests accepted!

pjz avatar Mar 19 '13 14:03 pjz

@colindean For better or for worse, Aspen isn't a CGI app, so afaict that library won't help us. Maybe we can use their code as an example?

chadwhitacre avatar Mar 19 '13 18:03 chadwhitacre

Implemented in www.gittip.com ; should pull it from there.

pjz avatar Sep 21 '13 17:09 pjz