nuster icon indicating copy to clipboard operation
nuster copied to clipboard

Can we force the first request return stale cache when stale on?

Open everyx opened this issue 2 years ago • 7 comments

and nuster send request to the backend server and update the cache at the same time.

btw, does the purge request mark the cache stale, and not directly deleting it? so nuster can still use the stale cache?

I want to ensure that the cache can be updated, and users will not feel that the server slows down accordingly at the same time.

everyx avatar Jul 07 '21 01:07 everyx

Can we force the first request return stale cache when stale on?

Yes

and nuster send request to the backend server and update the cache at the same time.

Not yet, it's on the todo list..

btw, does the purge request mark the cache stale, and not directly deleting it? so nuster can still use the stale cache?

No, purge mark the cache invalid

jiangwenyuan avatar Jul 07 '21 14:07 jiangwenyuan

Can we force the first request return stale cache when stale on?

Yes

How to do that? According to the comment in this issues, the first request will be always forwarded to the backend and response the return content then.

and nuster send request to the backend server and update the cache at the same time.

Not yet, it's on the todo list..

Great. exciting to wait this come true

btw, does the purge request mark the cache stale, and not directly deleting it? so nuster can still use the stale cache?

No, purge mark the cache invalid

Will cleaner clean up the stale caches immediately? Is there a plan to support mark cache's status to stale manually?

everyx avatar Jul 08 '21 01:07 everyx

My bad..It's still on the local development branch..I haven't touched on this for a while:)

Will cleaner clean up the stale caches immediately?

No

Is there a plan to support mark cache's status to stale manually?

Not as of now..

jiangwenyuan avatar Jul 08 '21 01:07 jiangwenyuan

My bad..It's still on the local development branch..I haven't touched on this for a while:)

hope it can be comming soon :)

Will cleaner clean up the stale caches immediately?

No

So can you give more details about stale caches cleanup process?

I want that the cache of stale will never be deleted until the memory / disk is about to exceeds the quota and running LRU cleanup then. So I can use cache as much as I can.

everyx avatar Jul 08 '21 07:07 everyx

So can you give more details about stale caches cleanup process?

It is controlled by disk-cleaner, if the file is stale ON or within stale TIME, it will not be deleted.

jiangwenyuan avatar Jul 08 '21 13:07 jiangwenyuan

So can you give more details about stale caches cleanup process?

It is controlled by disk-cleaner, if the file is stale ON or within stale TIME, it will not be deleted.

So the stale cache will never be deleted and will only be updated by the new cache?

everyx avatar Jul 09 '21 07:07 everyx

It will be deleted if stale TIME is expired

jiangwenyuan avatar Jul 09 '21 12:07 jiangwenyuan