2

I wanted to cache static resources so I set an expires header for static resources.

After setting the expires header, what I notice is:

  1. Firefox and IE do not send requests to nginx for static resources
  2. But all other browsers(Chrome, Safari, Opera) send a request to my nginx and nginx responds with 304 Not Modified

Are chrome, safari, opera caching my static resources? Is this normal behaviour? If not what should I do in addition so that static resources are cached by the other browsers?

j0k
  • 22,600
  • 28
  • 79
  • 90
rampr
  • 1,877
  • 4
  • 21
  • 36

1 Answers1

1

Take a careful look at the subsequent HTTP requests from chrome/safari/opera:

It's most likely a conditional GET. Also, the 304 Not Modified does not have a body.

So these browser cache too, just don't trust the content to stay the same before the expiration date.

They are just sniffing the milk in the fridge more often :-)

Szocske
  • 7,466
  • 2
  • 20
  • 24