Replies: 1 comment 1 reply
-
I'm interested in a solution to this as well. Setting cache-control headers inside a page's endpoint does not work, it only caches the __data.json path but has no effect on the html document for the page itself. |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
From what I understand you can set a HTTP
Cache-Control
header on a document so it gets slurped by a CDN and returns the document to avoid doing work on the server when using server-side rendering.This is confusing when it comes to SvelteKit and having page endpoints and standalone endpoints because they work differently.
If you don't have knowledge of page endpoints and how they use
__data.json
to pass data to the component you would think this doesn't work if you look at the document itself.This works how I expect and puts a
Cache-Control
header on the document.I'm confused because this seems to defeat the purpose of using page endpoints to reduce boilerplate when you can't set
Cache-Control
headers on the document.Do I pass the
props
and useload
?Am I missing something or doing it wrong?
Thank you! 😄
Beta Was this translation helpful? Give feedback.
All reactions