AdGuardHome icon indicating copy to clipboard operation
AdGuardHome copied to clipboard

Enhancement: Served from Optimistic cache information.

Open cenk opened this issue 6 months ago • 9 comments

Prerequisites

  • [X] I have checked the Wiki and Discussions and found no answer

  • [X] I have searched other issues and found no duplicates

  • [X] I want to request a feature or enhancement and not ask a question

The problem

Is it possible to see "served from Optimistic Cache" information in the Response details page when the responses are served by the Optimistic Cache?

Proposed solution

Is it possible to see "served from Optimistic Cache" information in the Response details page when the responses are served by the Optimistic Cache?

Alternatives considered and additional information

No response

cenk avatar Feb 16 '24 12:02 cenk

As far as I know, that information isn't available in the libraries currently.

Can you elaborate on why you want to see this information? Unless there are custom cache configurations involved, all “served from cache” are served from the optimistic one.

ainar-g avatar Feb 16 '24 12:02 ainar-g

It would be very useful to be able to see this information without turning on verbose/debug mode. Just like "stale cache" information on the query page in "pi-hole".

cenk avatar Feb 16 '24 12:02 cenk

So basically, the data you'd like to see is the number of cache misses due to TTL expiration?

ainar-g avatar Feb 16 '24 12:02 ainar-g

No. Just "Served from Optimistic cache" information istead of "served from cache" for each response.

Correction: in pi-hole v6 (beta) version.

cenk avatar Feb 16 '24 12:02 cenk

I'm sorry, but in that case what you're asking makes little sense. There are no two separate common caches, there is only one that either has optimistic mode enabled or not.

ainar-g avatar Feb 16 '24 13:02 ainar-g

Yes I know. There is only one cache. The name of the label may be different. May be "Served from cache (Optimistic response)" May be "Served from cache (Expired)"

cenk avatar Feb 16 '24 13:02 cenk

It would be better if you could provide a statistical display of the cache hit ratio

yuxuan0107 avatar Feb 25 '24 15:02 yuxuan0107

It would be better if you could provide a statistical display of the cache hit ratio如果可以提供缓存命中率的统计显示,那就更好了

Of course, if optimistic caching is enabled, the statistics of the cache hit ratio may be inaccurate, so two statistics may be required, one is used to statistically display the hit ratio of the cache, and the other is used to statistically display the accuracy of the cached data in the optimistic cache

yuxuan0107 avatar Feb 25 '24 15:02 yuxuan0107

It is also good if you can increase the current cache usage capacity or the current number of caches

yuxuan0107 avatar Feb 25 '24 15:02 yuxuan0107

@yuxuan0107, cache statistics are a part of #1453. Please keep discussions on-topic.

@cenk, I'm still not getting the feature request, sorry. What is the problem you're trying to solve? You've mentioned some kind of information that you want to track, but what information? How would it be actionable?

ainar-g avatar Feb 27 '24 14:02 ainar-g

@ainar-g, Can optimistic cache information be specified where I marked on this page? like "served from cache (optimistic response)" IMG_20240227_174621

cenk avatar Feb 27 '24 14:02 cenk