You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@httpd.apache.org by st...@apache.org on 2005/02/08 23:23:32 UTC
svn commit: r152948 - httpd/httpd/trunk/modules/cache/cache_storage.c
Author: striker
Date: Tue Feb 8 14:23:31 2005
New Revision: 152948
URL: http://svn.apache.org/viewcvs?view=rev&rev=152948
Log:
More mod_cache tweakage.
* modules/cache/cache_storage.c
(cache_select_url): Add If-Modified-Since regardless of having
an ETag or not. See: RFC2616, 14.26.
Modified:
httpd/httpd/trunk/modules/cache/cache_storage.c
Modified: httpd/httpd/trunk/modules/cache/cache_storage.c
URL: http://svn.apache.org/viewcvs/httpd/httpd/trunk/modules/cache/cache_storage.c?view=diff&r1=152947&r2=152948
==============================================================================
--- httpd/httpd/trunk/modules/cache/cache_storage.c (original)
+++ httpd/httpd/trunk/modules/cache/cache_storage.c Tue Feb 8 14:23:31 2005
@@ -249,19 +249,21 @@
const char *etag, *lastmod;
/* Make response into a conditional */
+
/* FIXME: What if the request is already conditional? */
etag = apr_table_get(h->resp_hdrs, "ETag");
- if (!etag) {
- lastmod = apr_table_get(h->resp_hdrs, "Last-Modified");
- }
+ lastmod = apr_table_get(h->resp_hdrs, "Last-Modified");
+
if (etag || lastmod) {
- /* if we have a cached etag or Last-Modified */
+ /* If we have a cached etag and/or Last-Modified */
+
cache->stale_headers = apr_table_copy(r->pool,
r->headers_in);
if (etag) {
apr_table_set(r->headers_in, "If-None-Match", etag);
}
- else if (lastmod) {
+
+ if (lastmod) {
apr_table_set(r->headers_in, "If-Modified-Since",
lastmod);
}