Skip to content

Commit b72a924

Browse files
committed
Passes only valid ttls to the metastore
1 parent 31b5448 commit b72a924

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/rack/cache/metastore.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ def store(request, response, entity_store)
8080
headers.delete 'Age'
8181

8282
entries.unshift [stored_env, headers]
83-
if request.env['rack-cache.use_native_ttl']
83+
if request.env['rack-cache.use_native_ttl'] && response.fresh?
8484
write key, entries, response.ttl
8585
else
8686
write key, entries

0 commit comments

Comments
 (0)