
Security News
Insecure Agents Podcast: Certified Patches, Supply Chain Security, and AI Agents
Socket CEO Feross Aboukhadijeh joins Insecure Agents to discuss CVE remediation and why supply chain attacks require a different security approach.
browserify-cache
Advanced tools
browserify-cache - Strong and weak caching for Browserify bundles
##Background
"Last-Modified" and "If-Modified-Since" are "weak" caching. If the "If-Modified-Since" header is set, then Browserify can send 304 Not Modified, if appropriate, which saves bandwidth.
"Expires" or "Cache-Control: max-age" are "strong" caching. The browser can simply pull from its own cache in certain cases to save an entire HTTP request.
In the client HTML, your Browserify bundle URL should contain the UNIX timestamp that matches the last modified date of the bundle.
https://github.com/substack/node-browserify
http://code.google.com/speed/page-speed/docs/caching.html
##Usage
//Create Express app and config...
//Setup browserify
var browserify = require('browserify');
var browserifyCache = require('browserify-cache');
var browserifyMiddleware = browserify(config.browserify);
app.use(express.browserifyCache(config.browserify, browserifyMiddleware) );
//Now you can expose this URL to your views using Express
app.helpers({
'browserifyMount': function() {
return config.browserify.mount + '.' + browserifyMiddleware.modified.getTime() + '.js';
}
});
FAQs
Easily cache Browserify bundles
We found that browserify-cache demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Socket CEO Feross Aboukhadijeh joins Insecure Agents to discuss CVE remediation and why supply chain attacks require a different security approach.

Security News
Tailwind Labs laid off 75% of its engineering team after revenue dropped 80%, as LLMs redirect traffic away from documentation where developers discover paid products.

Security News
The planned feature introduces a review step before releases go live, following the Shai-Hulud attacks and a rocky migration off classic tokens that disrupted maintainer workflows.