Can't set cache control - what am I doing wrong?
See original GitHub issueHere’s my plugin:
{
resolve: `gatsby-plugin-s3`,
options: {
bucketName: 'dogger.io',
protocol: "https",
hostname: "dogger.io",
params: {
'**/*.svg': {
ContentType: 'image/svg+xml',
CacheControl: 'public, max-age=31536000, immutable'
},
'**/*.woff': {
ContentType: 'font/woff',
CacheControl: 'public, max-age=31536000, immutable'
}
}
},
}
However, the CacheControl
metadata is not set correctly in S3. What am I doing wrong here?
Issue Analytics
- State:
- Created 3 years ago
- Comments:11 (3 by maintainers)
Top Results From Across the Web
Cache-Control - HTTP - MDN Web Docs
If you don't add a Cache-Control header because the response is not intended to be cached, that could cause an unexpected result. Cache...
Read more >Cannot set Cache-Control in Laravel 4 - php - Stack Overflow
But like I said, no matter what I set it to, it always returns a response header showing Cache-Control: no-cache, private. What am...
Read more >Best practices for cache control settings for your website
In this article, I will show you the right cache settings and techniques to help you keep your website up to date for...
Read more >Incorrect Cache-Control headers for authenticated users
no-cache means the resource can be cached, but that it must be revalidated each time before using it. The name of the header...
Read more >How Do I Fix My Caching Problems Or Clear Web Browser's ...
Try holding down the Shift key while pressing the Refresh button. · Close your browser and re-open it (make sure you are NOT...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
I believe I’ve found the cause of the issue. I think it’s #122. If the object has already been deployed, metadata won’t be updated unless the file contents are changed.
I have increased the severity of that issue now. I don’t have time to work on it myself, but we’d welcome a PR to fix it.
In the meantime, the workaround is to delete the affected files from the bucket manually and then redeploy.
Hi @ffMathy, I think @JoshuaWalsh resolved your issue here (be sure to thank him if he did). Regardless, I’m assuming this issue can be closed. Feel free to re-open if you have any new information.