atheme-legacy / iris

web irc client for the atheme platform
Other
38 stars 22 forks source link

Set the cache headers for static resources #38

Open megawac opened 10 years ago

megawac commented 10 years ago

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

mrflea commented 10 years ago

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 commented 10 years ago

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