A site testing tool tells me my static assets aren’t cached. How can I add caching to my static assets? I have a NEAT stack website (netlify, eleventy, alpine, tailwind).
Have you looked at this Support Guide on Netlify caching?
It links to this article too
These may help you out.
What testing tool(s) are you using?
thanks for the hint. i will look into this.
i’m using this tool: Yellow Lab Tools - Page Speed audit
The header that is mentions are used by Netlify appropriately as mentioned in the link posted by @coelmay. Changing that would require you to add custom headers for every asset individually.
Interesting to note that of the “9 offenders” Yellow Lab Tools identifies, 7 are SVG files which have exactly the same headers as your
uncritical.css file (
https://nicolas-sursock-webdev.netlify.app/static/css/uncritical.css) however it doesn’t identify it as an “offender”. This is quite possibly because the of the size of these SVGs (e.g.
https://nicolas-sursock-webdev.netlify.app/static/img/chat.svg is all of 348 bytes.)
Of course it also identified
alpine.js which is considerably bigger than
uncritical.css so make of that what you will.