Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Needs a good 'expires' header middleware #12

Open
hunterloftis opened this issue Mar 4, 2012 · 0 comments
Open

Needs a good 'expires' header middleware #12

hunterloftis opened this issue Mar 4, 2012 · 0 comments

Comments

@hunterloftis
Copy link
Contributor

Either as a standalone lib, or as a pull request into Connect or Express, ala:

http://developer.yahoo.com/performance/rules.html#expires

Perhaps with an API like this?

app.use(connect_expires(0)) // expires immediately
app.use(connect_expires(1000 * 60 * 60 * 24 * 7)) // expires one week after last access
app.use(connect_expires(new Date('24 august 2014')) // expires on a specific date

...where subsequent calls would just override old calls, so that you could do:

app.use(connect_expires(0)); // markup expires immediately
app.use(express.router);
app.use(connect_expires(1000 * 60 * 60 * 24 * 30)); // static files expire in a month
app.use(express.static(__dirname + '/public'));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant