Skip to content

Caching issue #2825

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

Closed
Maxime-J opened this issue Apr 9, 2025 · 1 comment
Closed

Caching issue #2825

Maxime-J opened this issue Apr 9, 2025 · 1 comment

Comments

@Maxime-J
Copy link

Maxime-J commented Apr 9, 2025

Some users who deployed Umami on Netlify started to have issues about responses being cached incorrectly (reference removed)

Here are a few queries which are returning the same cached response: (a part of 8 queries sent at the same moment)

/api/websites/[uuid]/metrics?startAt=1744092000000&endAt=1744178399999&unit=hour&timezone=Europe%2FParis&type=url&limit=10&search=
/api/websites/[uuid]/metrics?startAt=1744092000000&endAt=1744178399999&unit=hour&timezone=Europe%2FParis&type=referrer&limit=10&search=
/api/websites/[uuid]/metrics?startAt=1744092000000&endAt=1744178399999&unit=hour&timezone=Europe%2FParis&type=browser&limit=10&search=

Reading Netflify docs (https://docs.netlify.com/platform/caching/) and looking at the time the issue was first raised,
I wonder if this change could be the culprit: reference removed

In my understanding, having a Netlify-Vary with query=__nextDataReq is like saying that other query parameters don't affect the response, which is not the case, and all of the above queries end up in the same cache key whereas they shouldn't.
It looks like your docs example with Netlify-Vary: query=style|season.

Do I miss something?

@Maxime-J
Copy link
Author

After some more testing, these api queries could effectively be cached under the same cache key, but that was also the case before the __nextDataReq change.

Setting Cache-Control header to no-cache permitted to resolve that.

Note that setting Netlify-Vary header to query was also a possibility, it resolved the same response issue, but individual queries would still have been cached.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant