1

I have /favicon.ico aliased to a PHP script that randomly chooses one of several icons every time it is accessed, by returning a Location header to the location of the chosen icon.

However, I want a (potentially) different icon to be shown each time, though Chrome (only browser I've tested) appears to cache the icon for quite some time. I have added these headers to both the favicon.ico redirection and the PNG icon files themselves, however, the icon still gets cached by the browser.

Cache-Control: no-cache, no-store, must-revalidate
Pragma: no-cache
Expires: 0

I am using nginx. Is there any way to force the browser to refresh the icon every visit? Using the <link> tag in HTML is not an option for me.

Giacomo1968
  • 25,759
  • 11
  • 71
  • 103
user1814016
  • 2,273
  • 5
  • 25
  • 28

0 Answers0