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

feat(cache): support cached event handlers with varies #1184

Merged

Conversation

Botz
Copy link
Contributor

@Botz Botz commented Apr 23, 2023

πŸ”— #1031

❓ Type of change

  • πŸ“– Documentation (updates to the documentation or readme)
  • 🐞 Bug fix (a non-breaking change that fixes an issue)
  • πŸ‘Œ Enhancement (improving an existing functionality like performance)
  • ✨ New feature (a non-breaking change that adds functionality)
  • ⚠️ Breaking change (fix or feature that would cause existing functionality to change)

πŸ“š Description

Resolves #1031
Adds an optional property varies to the cache options.
If varies option is present in the requests headers the value will be considered in key generation.
So if someone sets varies: [ 'host' ] example.com and exmaple.de will generate different cache entries

πŸ“ Checklist

  • I have linked an issue or discussion.
  • I have updated the documentation accordingly.

@nuxt-studio
Copy link
Contributor

nuxt-studio bot commented Apr 23, 2023

βœ… Live Preview ready!

Name Edit Preview Latest Commit
nitro Edit on Studio β†—οΈŽ View Live Preview cc232a4

src/runtime/cache.ts Outdated Show resolved Hide resolved
@Botz
Copy link
Contributor Author

Botz commented Jun 19, 2023

@pi0 any updates on this?

@codecov
Copy link

codecov bot commented Jul 16, 2023

Codecov Report

Merging #1184 (cc232a4) into main (1b9815f) will decrease coverage by 0.06%.
The diff coverage is n/a.

@@            Coverage Diff             @@
##             main    #1184      +/-   ##
==========================================
- Coverage   76.38%   76.33%   -0.06%     
==========================================
  Files          73       73              
  Lines        7550     7550              
  Branches      745      744       -1     
==========================================
- Hits         5767     5763       -4     
- Misses       1782     1785       +3     
- Partials        1        2       +1     

see 1 file with indirect coverage changes

@pi0 pi0 force-pushed the feature/1031-support-cached-event-handlers-with-varies branch from 225805b to f8711a5 Compare August 6, 2023 23:58
@pi0 pi0 merged commit 9ce2f64 into nitrojs:main Aug 7, 2023
8 checks passed
@pi0 pi0 mentioned this pull request Aug 21, 2023
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

Successfully merging this pull request may close these issues.

Support cached event handlers with varies (custom headers)
3 participants