prerender-redis-cache
prerender-redis-cache copied to clipboard
Clear cache
Are you still going to be implementing a clear cache option for this?
Hi @dottodot - I haven't had time to do it yet but would definitely like to do it sometime soon - it wouldn't take long to implement. Let me see if I can get to this at the weekend.
Any news about this feature? I want option i can give the url and it will remove this url from redis cache. Thanks in advance
Sorry both, I have this on a branch but haven't had time to test it. Does someone want to peer review? I'll commit for vis.
If you do a DELETE request on the URL removes from cache.
/cc @dottodot @yagobski
OK I have confirmed that req.method is DELETE and redis_online is true but that means it won't work as this would be true
if (req.method !== 'GET' || redis_online !== true)
should it not be
if (req.method !== 'GET' && req.method !== 'DELETE' || redis_online !== true)
I have tried this but I then get the following error
stream.js:94
throw er; // Unhandled stream error in pipe.
^
Error: Can't set headers after they are sent.
at ServerResponse.OutgoingMessage.setHeader (http.js:690:11)
at /Users/marcus/hosts/prerender/lib/server.js:416:21
at Array.forEach (native)
at /Users/marcus/hosts/prerender/lib/server.js:415:35
at next (/Users/marcus/hosts/prerender/lib/server.js:57:28)
at next (/Users/marcus/hosts/prerender/lib/server.js:64:13)
at Object.module.exports.beforeSend (/Users/marcus/hosts/prerender/lib/plugins/httpHeaders.js:33:9)
at next (/Users/marcus/hosts/prerender/lib/server.js:62:20)
at Object.module.exports.beforeSend (/Users/marcus/hosts/prerender/lib/plugins/removeScriptTags.js:14:9)
at next (/Users/marcus/hosts/prerender/lib/server.js:62:20)
Any movement on this, guys?
So, 3 years later and I'm coming around to using this package again.
Version 0.3.0 (branch delete-url) allows you to DELETE on an endpoint, which will cause it to delete from the cache and then fetch the new version before returning the content.
Let me know if this works for you all! (Only took 3 years!) If so, we'll get it merged and released as v0.3.0