Skip to content
This repository was archived by the owner on Jan 11, 2023. It is now read-only.

remove cache-control header #1173

Merged
merged 2 commits into from
Aug 2, 2020
Merged

remove cache-control header #1173

merged 2 commits into from
Aug 2, 2020

Conversation

gka
Copy link
Contributor

@gka gka commented Apr 28, 2020

This PR resolves the outstanding maxage header issue. A fixed maxage header is not practical. There should be either a way to customize the maxage, or, more simple, the Sapper middleware shouldn't even set it at all.

The solution is to remove the res.setHeader('Cache-Control', dev ? 'no-cache' : 'max-age=600'); line and the corresponding test.

@benmccann
Copy link
Member

benmccann commented May 13, 2020

The current behavior seems extremely severely broken to me. This code path only serves dynamic content, so the expectation would certainly be that nothing is cached.

There's a number of users reporting issues in #567 with well thought out and described issues. This includes Sapper regulars such as @antony who described this as "mission critical" and "very high priority" because the current behavior results in "weird half-broken state for all my users" #567 (comment)

@antony antony added the breaking Breaking Changes label May 13, 2020
@benmccann
Copy link
Member

@antony is this a breaking change? It changes behavior, but I'm having a hard time envisioning a scenario where it's not backwards compatible or breaks something

@antony
Copy link
Member

antony commented May 13, 2020

@benmccann if you remove the cache-control header (which a number of CDNs use to decide how to cache your pages) it will certainly change the way your site operates, which I'd suggest is breaking.

@antony antony added this to the 0.28 milestone Jul 30, 2020
@benmccann benmccann linked an issue Jul 31, 2020 that may be closed by this pull request
@benmccann benmccann merged commit ee59054 into sveltejs:master Aug 2, 2020
habibrosyad pushed a commit to habibrosyad/sapper that referenced this pull request Aug 4, 2020
trmcnvn pushed a commit to metafy-gg/sapper that referenced this pull request Aug 15, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
breaking Breaking Changes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Feature request: custom cache-control headers
3 participants