diff options
author | Peter Hartmann <peter.hartmann@nokia.com> | 2009-09-29 08:38:33 (GMT) |
---|---|---|
committer | Peter Hartmann <peter.hartmann@nokia.com> | 2009-09-29 09:05:17 (GMT) |
commit | 777c02085e0f30d0dceb57a9ac96a44999b4a028 (patch) | |
tree | e5419d2efa969c1c9d05480c6ce2f715da9556dc /src | |
parent | e6fe0607cc213e29cb83d4c26550f196cb1c5129 (diff) | |
download | Qt-777c02085e0f30d0dceb57a9ac96a44999b4a028.zip Qt-777c02085e0f30d0dceb57a9ac96a44999b4a028.tar.gz Qt-777c02085e0f30d0dceb57a9ac96a44999b4a028.tar.bz2 |
HTTP backend: store the date header in the cached resource
we need the date header to calculate the age of the page, although this
increases disk usage when using a QNetworkDiskCache. A solution to
reduce the disk access of QNetworkDiskCache will be considered for a
later version of Qt.
Reviewed-by: Markus Goetz
Reviewed-by: Aleksandar Sasha Babic
Diffstat (limited to 'src')
-rw-r--r-- | src/network/access/qnetworkaccesshttpbackend.cpp | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/src/network/access/qnetworkaccesshttpbackend.cpp b/src/network/access/qnetworkaccesshttpbackend.cpp index c068f55..bfcc299 100644 --- a/src/network/access/qnetworkaccesshttpbackend.cpp +++ b/src/network/access/qnetworkaccesshttpbackend.cpp @@ -951,11 +951,14 @@ QNetworkCacheMetaData QNetworkAccessHttpBackend::fetchCacheMetaData(const QNetwo if (hop_by_hop) continue; - // Do not copy over the Date header because it will be - // different for every request and therefore cause a re-write to - // the disk when a 304 is received inside replyHeaderChanged() - if (header == "date") - continue; + // for 4.6.0, we were planning to not store the date header in the + // cached resource; through that we planned to reduce the number + // of writes to disk when using a QNetworkDiskCache (i.e. don't + // write to disk when only the date changes). + // However, without the date we cannot calculate the age of the page + // anymore. Consider a proper fix of that problem for 4.6.1. + //if (header == "date") + //continue; // Don't store Warning 1xx headers if (header == "warning") { |