summaryrefslogtreecommitdiffstats
path: root/src/network
diff options
context:
space:
mode:
authorPeter Hartmann <peter.hartmann@nokia.com>2011-03-31 12:50:20 (GMT)
committerPeter Hartmann <peter.hartmann@nokia.com>2011-04-08 13:22:35 (GMT)
commit5ec9333d9f0e7ea5f39eb0f5250e90399423e6e5 (patch)
tree318a03d1eda503f4d828d1e5bed7ff8a7ac4c646 /src/network
parent688d6db785af821e76b9e436ef9d9cbea95ef5ad (diff)
downloadQt-5ec9333d9f0e7ea5f39eb0f5250e90399423e6e5.zip
Qt-5ec9333d9f0e7ea5f39eb0f5250e90399423e6e5.tar.gz
Qt-5ec9333d9f0e7ea5f39eb0f5250e90399423e6e5.tar.bz2
HTTP cacheing: do not store the date header with the resource
... to avoid re-writing the resource to disk when retrieving the resource from cache. We are currently using the "Expires", "max-age" and "s-maxage" headers to determine when a cached resource will expire. Autotests still pass and the demo browser reports the same amount of pages loaded from the cache. Reviewed-by: Markus Goetz
Diffstat (limited to 'src/network')
-rw-r--r--src/network/access/qnetworkaccesshttpbackend.cpp13
1 files changed, 5 insertions, 8 deletions
diff --git a/src/network/access/qnetworkaccesshttpbackend.cpp b/src/network/access/qnetworkaccesshttpbackend.cpp
index 108ac68..7c90f68 100644
--- a/src/network/access/qnetworkaccesshttpbackend.cpp
+++ b/src/network/access/qnetworkaccesshttpbackend.cpp
@@ -1001,14 +1001,11 @@ QNetworkCacheMetaData QNetworkAccessHttpBackend::fetchCacheMetaData(const QNetwo
if (hop_by_hop)
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.
- //if (header == "date")
- //continue;
+ // we are currently not using the date header to determine the expiration time of a page,
+ // but only the "Expires", "max-age" and "s-maxage" headers, see
+ // QNetworkAccessHttpBackend::validateCache() and below ("metaData.setExpirationDate()").
+ if (header == "date")
+ continue;
// Don't store Warning 1xx headers
if (header == "warning") {