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

Distributable cache for files #496

Merged
merged 2 commits into from
Feb 10, 2013
Merged

Distributable cache for files #496

merged 2 commits into from
Feb 10, 2013

Conversation

mikeal
Copy link
Contributor

@mikeal mikeal commented Feb 8, 2013

The current HTTP caching for files uses last-modified and an etag based on the ino, size and modified time. The problem with this approach is that both headers end up being inconsistent between nodes on a network.

This branch removes Last-Modified entirely, since it's impossible to make it consistent across nodes without using a networked filesystem.

This branch replaces the old etag with a new one that is a hash of the entire file. That etag is kept in an LRU cache keyed by the filepath, ino, size and mtime. This means that the first time a file is requested after process start or file modification it will not return an etag but will return an etag for every request for that file afterward.

@ghost ghost assigned hueniverse Feb 8, 2013
hueniverse pushed a commit that referenced this pull request Feb 10, 2013
Distributable cache for files
@hueniverse hueniverse merged commit ad51166 into hapijs:master Feb 10, 2013
jmonster pushed a commit to jmonster/hapi that referenced this pull request Feb 10, 2014
Distributable cache for files
@lock lock bot locked as resolved and limited conversation to collaborators Jan 10, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
feature New functionality or improvement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants