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

Vary header should be included in all Inertia responses #124

Open
ariel-codes opened this issue Jul 10, 2024 · 0 comments · May be fixed by #128
Open

Vary header should be included in all Inertia responses #124

ariel-codes opened this issue Jul 10, 2024 · 0 comments · May be fixed by #128

Comments

@ariel-codes
Copy link

Hi! I've stumbled upon a very specific error when an Inertia page is served from the browser cache:

  1. First, HTML page is accessed, response is cached
  2. Then, a partial reload on the same URL, expecting a Inertia JSON response (with X-Inertia header)
  3. Inertia gets served first HTML, errors and shows response inside a modal

Taking a look at the InertiaRails::Renderer, it seems that the Vary header that would prevent this from happening is only added for subsequent X-Inertia Inertia responses – and so the browser still uses the first response for all cache hits.

I'm testing a monkey-patch fix on my app and could open a PR if this is the correct diagnosis.

@skryukov skryukov linked a pull request Jul 21, 2024 that will close this issue
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 a pull request may close this issue.

1 participant