Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add context.cache.status #2925

Open
1 task done
cjpearson opened this issue Dec 6, 2024 · 2 comments
Open
1 task done

Add context.cache.status #2925

cjpearson opened this issue Dec 6, 2024 · 2 comments
Labels
cache enhancement New feature or request

Comments

@cjpearson
Copy link
Contributor

Describe the feature

When using page caching, I'm interested in knowing if a request was served from the cache or not. Would it be possible to add a status property which makes this information accessible from the event? A very basic solution could be the following:

    cache: {
      options: CacheOptions;
      status?: 'hit' | 'miss' | 'none'
    };

Where 'hit' indicates that the request was served from the cache, 'miss' indicates no valid cached response was found, and 'none' is for requests which are not cached. What do you think?

Related:

#2520
#2519

Additional information

  • Would you be willing to help implement this feature?
@pi0 pi0 added enhancement New feature or request cache and removed pending triage labels Dec 6, 2024
@pi0
Copy link
Member

pi0 commented Dec 6, 2024

This is nice idea. i might delay more changes like this to cache since it is in transition to be an external package for better testing and extension.

(BTW I noticed you are contributing a lot to cache side, I would love to have you onboard it if interested :)

@cjpearson
Copy link
Contributor Author

Thanks for the heads up! Yeah I'd be happy to help where I can

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cache enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants