Skip to content

Conversation

@megawac
Copy link

@megawac megawac commented Mar 12, 2014

Set the cache headers on static resources for 30 days

Wrote this for my fork; figured you guys may be interested in this change

Accept-Ranges: bytes
Cache-Control: max-age=2592000, public
Connection: keep-alive
Content-Encoding: gzip
Content-length: 0
Date: Wed, 12 Mar 2014 16:18:57 GMT
Expires: Fri, 11 Apr 2014 00:00:00 GMT
Last-Modified: Wed, 12 Mar 2014 15:06:01 GMT
Server: TwistedWeb/13.1.0

Edit - just noticed I forgot to remove a debug statement in caching - my bad

@kbuck1
Copy link
Contributor

kbuck1 commented Apr 7, 2014

I'm worried that caching for 30 days is a bit long (mostly because this includes the JavaScript as it is 'static content'). I'll think about this pull request a bit more.

@megawac
Copy link
Author

megawac commented Apr 7, 2014

Ya, honestly I didn't think too much in to the period and probably add an option to set it in the config file. Would you like me to patch without the debug statement and an option in the config for the period.

Edit also don't the JS and css files get given a random hash suffix on compile? So that shouldn't be a concern

Add an option to set the duration of the cache. 30 day default
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants