Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What does "stale, valid, store" mean when accessing a cache in Rails?

In my log I have many things like this:

cache: [GET /assets/widget.png] stale, valid, store

What does it mean? Is it a cache miss or hit? What does it mean to be stale and also valid?

like image 808
John Bachir Avatar asked Nov 21 '11 20:11

John Bachir


1 Answers

What it means is that the entry was stale and a conditional request was issued (a request with If-Modified-Since header). The origin server responded with a 304 (Not Modified) status code, implying that the cache entry is valid.

In other words the origin server was reached (miss?) BUT it didn't send the object again, it just validated it since it was not modified.

like image 165
lalibi Avatar answered Nov 01 '22 11:11

lalibi