cacache icon indicating copy to clipboard operation
cacache copied to clipboard

Replacing stale content

Open nikdo opened this issue 6 years ago • 2 comments

I am using cacache with make-fetch-happen to cache fetch responses from a forecast API. These responses are pretty big (~60 kB) and differ every hour.

What worries me a little bit is the fact that stale responses are kept by default. I expected the stale response to be replaced by the fresh one if the key matches.

I've investigated the documentation thoroughly and the closest thing I've found is calling rm.content just before putting new one.

Is this the right thing to do? Have I overlooked something? What is the reason for keeping stale responses by default? Is purging stale responses out of the scope of this library? If this is generally accepted cache behavior, can you please point me to some explanation?

Thank you.

nikdo avatar Dec 26 '18 12:12 nikdo

I'm facing a similar issue, isn't there any form of expiration or something similar in this library?

ohenepee avatar May 31 '19 11:05 ohenepee

I don't think so. I settled up with deleting cache manually using cron.

nikdo avatar May 31 '19 11:05 nikdo