]> git.ipfire.org Git - thirdparty/squid.git/commit - src/tests/testStoreHashIndex.cc
Bug 4471: revalidation doesn't work when expired cached object lacks Last-Modified.
authorEduard Bagdasaryan <eduard.bagdasaryan@measurement-factory.com>
Sat, 17 Sep 2016 16:50:30 +0000 (04:50 +1200)
committerAmos Jeffries <squid3@treenet.co.nz>
Sat, 17 Sep 2016 16:50:30 +0000 (04:50 +1200)
commit438b41ba09cac14b3b9758f0bfd50e98711fcc8c
treeac7f27ee9be4e8fc72b4d8a26fea409992bfc645
parenta2958f2f30c814993e75013bc6fce7fbd720e545
Bug 4471: revalidation doesn't work when expired cached object lacks Last-Modified.

The bug was caused by the fact that Squid used only Last-Modified header
value for evaluating entry's last modification time while making an
internal revalidation request. So, without Last-Modified it was not
possible to correctly fill If-Modified-Since header value. As a result,
the revalidation request was not initiated when it should be.

To fix this problem, we should generate If-Modified-Since based on other
data, showing how "old" the cached response is, such as Date and Age
header values. Both Date and Age header values are utilized while
calculating entry's timestamp. Therefore, we should use the timestamp if
Last-Modified is unavailable.

TODO: HttpRequest::imslen support looks broken/deprecated. Using this
field inside StoreEntry::modifiedSince() leads to several useless checks
and probably may cause other [hidden] problems.
17 files changed:
src/MemStore.cc
src/Store.h
src/client_side_reply.cc
src/fs/rock/RockSwapDir.cc
src/fs/ufs/RebuildState.cc
src/fs/ufs/UFSSwapDir.cc
src/htcp.cc
src/http/Stream.cc
src/ipc/StoreMap.cc
src/peer_digest.cc
src/refresh.cc
src/stat.cc
src/store.cc
src/store_rebuild.cc
src/tests/stub_store.cc
src/tests/testStoreController.cc
src/tests/testStoreHashIndex.cc