question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Make cache headers configurable for contents of `static`

See original GitHub issue

Describe the bug Cache Headers for images in the static folder are set to public,max-age=0,must-revalidate. This happens even in production builds (svelte-kit build, svelte-kit start).

Logs image

To Reproduce Prepared a example repo. https://github.com/Maggi64/svelte-kit-cache-header-issue

Expected behavior As far as i understand the code, cache headers should be set to immutable. Am i missing something here?

Thanks for the great work guys. Keep it up! PixelPepeFedora

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:13 (12 by maintainers)

github_iconTop GitHub Comments

1reaction
benmccanncommented, Apr 2, 2021

They said “We have icons that will never change and if we would alter the path” and were also asking for the cache header to be set to immutable, so I think they do have stable contents

1reaction
Maggi64commented, Mar 31, 2021

Makes sense, in sapper you could configure sirv yourself and we treated those images as unchangeable. Might be a good idea to add a setting to change this behavior.

We have icons that will never change and if we would alter the path.

Thanks for the quick response.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Guide for Caching and HTTP Cache Headers for Static Content
Best practices for cache management of static assets and using the correct cache headers like Cache-Control.
Read more >
Adding Cache-Control headers to Static Files in ASP.NET Core
In this post I'll show how you can add caching headers to the files served by the StaticFileMiddleware to increase your site's performance....
Read more >
Caching headers for static content: cache-control: private is sen
Hi everybody. We have setup caching for static content as described in ...
Read more >
How to Cache Static Content with Varnish Cache - Section.io
One common setting that can prevent Varnish Cache from caching items by default is when the website server settings add headers such as...
Read more >
Caching headers: A practical guide for frontend developers
Find out how different headers influence browser cache, how they relate to proxy servers, and how popular services created in React serve ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found