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.

Can't set cache control - what am I doing wrong?

See original GitHub issue

Here’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:closed
  • Created 3 years ago
  • Comments:11 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
JoshuaWalshcommented, Jul 8, 2020

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.

0reactions
jarizcommented, Jul 23, 2020

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.

Read more comments on GitHub >

github_iconTop 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 >

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