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

chore: add cache headers #651

Merged
merged 2 commits into from
Dec 6, 2023

Conversation

vwong
Copy link
Contributor

@vwong vwong commented Dec 5, 2023

We want to avoid clients from accidentally caching these, so let's tell them not to!

@bethesque
Copy link
Member

Remember to put the ticket number in the commit!

@bethesque bethesque merged commit 9a63732 into pact-foundation:master Dec 6, 2023
@bethesque
Copy link
Member

This is user facing, so I've squash merged it as a feat: rather than a chore:.

@bethesque
Copy link
Member

So, I shouldn't have merged this, because where this has been inserted into the middleware stack will cause it to disable cache for ALL resources, not just API resources. It means that static assets now don't get cached.

Can you move it after the @app_builder.use Rack::Static... lines please?

@bethesque
Copy link
Member

So, the React UI uses these headers for the index page.

        "Cache-Control" => "no-cache, no-store, must-revalidate",
            "Pragma" => "no-cache",
            "Expires" => "0",
            "Vary" => "Accept, Accept-Encoding"

Should we be using all of those do you think?

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.

2 participants