11

I need to clear the cache for one file in Chrome.

I was setting up loading a font from my own CDN, and added the cache-control: public, max-age=31536000, immutable header. However, I did not setup CORS correctly, so I got a CORS error. Now, that CORS error is fixed, but Chrome is still serving the old request because of the cache control header.

Note: I only need to clear the cache this one time. I want the font to be immutable in the future.

Things I've tried

  • Clear recent browser cache from settings
  • In Devtools > Network, select "Disable cache"
  • In Devtools > Network, right-click the network request and select "Clear from cache"
  • Hard reload with ⌘⇧R (on a Mac)
  • Long-click the refresh button in the upper left and select "Empty cache and hard reload" (https://stackoverflow.com/a/7000899/11506995)

And I can confirm that the CORS error for two reasons:

  • Now works in Safari (didn't before)
  • Running curl -IL -X'GET' -H'Origin: http://localhost:3000' https:example.com/file returns the correct CORS headers

Related posts

sideshowbarker
  • 81,827
  • 26
  • 193
  • 197
Nick
  • 5,108
  • 2
  • 25
  • 58
  • 1
    I thought I was having the same issue as you, but it turns out that it was the HTTPS Everywhere browser extension injecting the `upgrade-insecure-requests` header. – swrobel Aug 12 '21 at 00:32
  • I thought I was having the same issue as you but in my case I had two things setting CORS headers - my own settings and, unbeknown to me, the WordPress REST API - what I thought was my old setting in .htaccess was in fact WordPress setting them. It didn't work for me because I had two conflicting sets. – Kropotkin Oct 05 '22 at 18:21

0 Answers0