h5bp/server-configs — pull request #41 by AD7six (2012-01-27 14:33:41+00:00)
Title: nginx - do not set a default expire header

## In Short

The current expire logic for nginx is:

* By default any and all requests expire in a month
* manifest and appcache requests are served already-expired
* Except css/js/images/assets which don't expire

Setting a default expire will interfere with any dynamic page content - for this reason I suggest to remove this expire rule. It's not obvious at a glance (or maybe it is and I'm just too noob from time to time) that the existing default rule will literally apply to all requests to the server. The comment that I have moved also implies it's in the wrong place, the example give is a js file yet the default expire rule will never apply to a js file as it would be captured and overriden by the next ruleset.

## Consistency

This leads to another point, and that is consistency. It's while since I've used anything except nginx, but:

lighttpd

* static files don't expire
* Catchall to expire any other request in a month

web.config

* No default expire in the config file
* static files don't expire

node.js

* No expire logic in the config file

gae

* Default expire of 30days
* atom expires in an hour
* html expires in an hour
* ico expires in 7days
* json expires in 1hour
* rss expires in 1hour

apache (from h5bp, naturally)

* Default expire of 1 month
* appcache expires immediately
* html expires immediately
* xml expires immediately
* json expires immediately
* atom expires in an hour
* rss expires in an hour
* ico expires in 7days
* css and js expire in a year
* other assets expire in a month

It doesn't seem logical that changing webserver and chosing the appropriate h5bp server config file completely changes the expire logic applied.

Therefore as a follow up to this pull request I propose to action this comment: https://github.com/h5bp/html5-boilerplate/commit/4e17c6dc#L0R96 and then use the apache config as the canonical expire logic which other configs should replicate as close as possible.