Does the ETag include an invalid Cache-Control header?

I am fetching a resource from my RESTful web service and in the response I add these two headers:

Cache-Control: public, max-age=120
ETag: "3D03F8066015A1438532E049AE5E16EA"

      

The first time the browser received this response, it secretly pinned it for 2 minutes.

However, the next time I asked for a resource, my browser now sent the header IfNoneMatch

and received 304 Not Modified

, as expected, along with another header Cache-Control

to cache within 2 minutes.

BUT the browser did not cache the response. I keep refreshing the page and it keeps making the request and so it keeps getting 304 Not Modified

.

Is this normal behavior?

How can I tell the browser to re-check my cached resource for another 2 minutes after receiving it 304 Not Modified

and not make more requests?

+3


source to share





All Articles