apicache icon indicating copy to clipboard operation
apicache copied to clipboard

How to ignore cache but still save the result at the end

Open msieurtoph opened this issue 5 years ago • 2 comments

Hello,

In my case, my app is exposing a URL that takes a long time to respond due to slow internal processes. I would like to cache it and serve it on demand ...

But I would like to allow user to skip cache sometimes and force app to recalculate page content. The point is that in the end, I would like to cache this new content, so that the next users will benefit from the most recent content.

How to tell Apicache punctually: don't read the cache ... but continue writing to it?

Any help appreciated;) Thx

msieurtoph avatar Aug 07 '20 13:08 msieurtoph

I found this https://github.com/kwhitley/apicache/pull/17. I guess 'x-apicache-force-fetch' was supposed to do this ... but it doesn't seem to work anymore. The behavior is exactly the same than 'x-apicache-bypass'

Any explanation ?

msieurtoph avatar Aug 07 '20 14:08 msieurtoph

I finally pushed the fllowing PR to restore the original behavior : https://github.com/kwhitley/apicache/pull/220

msieurtoph avatar Aug 07 '20 15:08 msieurtoph