You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I see that you calculate the etag using the file mtime (modify time), this is all nice and good when working from a single machine with a single copy of the file been served, but can be really problematic when serving from a cluster since the file is located across machines (with different mtime) and therefor different etag, causing the cached file to invalidated over and over again.
Maybe you can use md5/sha1 of the file instead of mtime, this way even from different machines in the cluster you will get the same etag.
I am aware that I shouldn't serve static files straight from node.js and use some kind of reverse proxy(nginx, varnish, squid) between node.js and the outer world.
Hi,
I see that you calculate the etag using the file mtime (modify time), this is all nice and good when working from a single machine with a single copy of the file been served, but can be really problematic when serving from a cluster since the file is located across machines (with different mtime) and therefor different etag, causing the cached file to invalidated over and over again.
Maybe you can use md5/sha1 of the file instead of mtime, this way even from different machines in the cluster you will get the same etag.
I am aware that I shouldn't serve static files straight from node.js and use some kind of reverse proxy(nginx, varnish, squid) between node.js and the outer world.
See
http://developer.yahoo.com/performance/rules.html#etags
The text was updated successfully, but these errors were encountered: