If I clear whole cache for the app, does it mean all requests to it will be cache misses? When using staleWhileRevalidateSeconds, does it still keep stale caches to serve for the first user request?
If you clear the cache, you also remove stale responses, so the next request for any given URL will be a miss. If you have static prerendering enabled, it will rerun on a full cache clear.
Would be nice to have an option to keep staleWhileRevalidate cache after clearing. This can keep high cache hit ratios even for rapidly changing content.
We do have an option to preserve the cache during deploy. You are then responsible for clearing the parts of your cache that should be cleared.
@ianand Let me try to explain this. In my opinion, would be nice to have a feature to “mark” some parts of the cache as stale, not to remove them completely. Then I need just wait until URL will be accessed and staleWhileRevalidateSeconds will update the cache, in the same time returning cached result to the user.