pajtai / express-static-file-cache Goto Github PK
View Code? Open in Web Editor NEWCache files as static html for express
Home Page: https://www.npmjs.com/package/express-static-file-cache
Cache files as static html for express
Home Page: https://www.npmjs.com/package/express-static-file-cache
var cachePath = path.join(cacheDir, req.url);
Doesn't reflect the correct paths when using express 4.0 router functions
var router = require("./routes/router");
app.use("/router/", router);
router.get("/", function(req, res {
});
should be
cachePath = "/router/index.html";
but only gets index.html
Currently for a workaround see: #1 (comment)
The readme is incorrect for the configuration setup
should be:
app.use(require('express-static-file-cache').configure({
app : app,
express : express,
cacheDir : cacheDir
}));
Also, any chance for EJS support? Looking into the EJS's version of the compile and see if it's a straight port.
Use case is if for example you are fetching data that includes an editorial window (or other TTL) where you know that in X hours you will want this page to change, become a 404, or go from a 404 to a 200.
If a project is using PUG, this module fails. Will submit pull request.
There's an issue with caching additional GET requests parameters
for example
curl http://localhost:1337/stuff/
creates cache
/stuff/index.html
now
curl http://localhost:1337/stuff/?otherStuff=1&futureStuff=2
Reads the previous /stuff/index.html cache if it's there
Thoughts on solving that issue?
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.