tdebarochez / connect-cache Goto Github PK
View Code? Open in Web Editor NEWCaching system for Connect framework
Home Page: https://github.com/tdebarochez/connect-cache
License: MIT License
Caching system for Connect framework
Home Page: https://github.com/tdebarochez/connect-cache
License: MIT License
URLs should be treated case insensitive since Express does so, to avoid duplicate caches.
https://groups.google.com/forum/#!topic/express-js/ta-59SfB180
If a client sends the "cache-control" value "no-cache" connect-cach
completely ignores caching.
In my opinion this is wrong and for me a not desired behavior.
Due to https://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.9.4 a client can request "no-cache" for forcing an end-to-end reload. This is done in connect-cach
. But the response is not cached. In my opinion the newly loaded content (= response) is allowed to and should be cached.
Additionally I would like to see a swicth which completely ignores the "cache-control" header in client requests - to force caching even if the client requests something different.
My scenario:
I have a local development web server with live reload of my web app. I am proxying and caching external libraries from content delivery networks for traffic and performance reasons with connect-cache
. In chrome I hit CTRL+F5 to reload with invalidating the cache (on client and server side). Chrome sends "no-cache" wich is ok - content should be (re-)loaded from the origin. But my next regular reload (Key F5) should come from the (server) cache.
With some storage engine, it's could be more efficient to store datas & metas together (ie: CouchDB)
it would be very useful if you could add the cache-control feature like in connect's static middleware, so when the browser have the same data like connect-cache in the cache you don't need to send the data again.
the file connect-cache.js uses the default ttl instead of the ttl specified with each rule.
fix on line 100: use ttl instead of options.ttl
there's also a bug in memory.js on line 19:
replace cb(null); with cb && cb(null);
besides this, i really like your library! :)
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.