Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Fix false cache hits for file downloads (issue #367)#384

Open
Siddhartha-singh01 wants to merge 2 commits into
openml:masteropenml/openml.org:masterfrom
Siddhartha-singh01:fix/issue-367-cache-hitsSiddhartha-singh01/openml.org:fix/issue-367-cache-hitsCopy head branch name to clipboard
Open

Fix false cache hits for file downloads (issue #367)#384
Siddhartha-singh01 wants to merge 2 commits into
openml:masteropenml/openml.org:masterfrom
Siddhartha-singh01:fix/issue-367-cache-hitsSiddhartha-singh01/openml.org:fix/issue-367-cache-hitsCopy head branch name to clipboard

Conversation

@Siddhartha-singh01

Copy link
Copy Markdown

This PR addresses the issue where some clients (like the R bindings) were receiving corrupt/compressed data because the proxy was serving cached gzip/brotli responses to clients that didn't support them.

What I changed in

app-next/src/app/api/proxy-file/route.ts

1 - Forwarded Accept-Encoding: The proxy now passes the client's original encoding preferences to the upstream server. This ensures the upstream only sends compressed data if the client actually asked for it.
2 - Added Vary: Accept-Encoding: I added this header to the proxy's response. This tells CDNs and intermediate caches to store separate versions of the file based on the client's encoding support, preventing "cross-client" cache contamination.
3 - Passed through Content-Encoding: If the upstream does return compressed data, the proxy now correctly forwards that header so the client knows it needs to decompress the response.

Testing done:

1 - Ran a full npm run build to make sure the route compiles correctly.
2 - Verified with tsc --noEmit and eslint (0 errors).
3 - Double-checked the logic to ensure we aren't adding unnecessary headers to non-binary files.
Fixes #367

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

Successfully merging this pull request may close these issues.

False cache hits leading to corrupt downloads

1 participant

Morty Proxy This is a proxified and sanitized view of the page, visit original site.