Port of 2.7 ignore_ims_on_miss directive by Henrik Nordstrom.
This on/off switch enables Squid to convert conditional requests from
clients to non-conditional fetches that can fill the cache faster under
cold-start conditions.
<sect1>New tags<label id="newtags">
<p>
<descrip>
+ <tag>cache_miss_revalidate</tag>
+ <p>Whether Squid is to pass-through If-Modified-Since and If-None-Match headers on cache MISS.
+ Revalidation requests can prevent cache gathering objects to HIT on.
+ <p>Based on the Squid-2.7 <em>ignore_ims_on_miss</em> feature.
+ <p><em>IMPORTANT:</em> the meaning for on/off values has changed along with the name since 2.7.
+
<tag>request_header_add</tag>
<p>New directive to add custom headers on HTTP traffic sent to upstream servers.
<p>
<descrip>
- <p><em>There are no removed squid.conf options in Squid-3.3.</em>
+ <tag>ignore_ims_on_miss</tag>
+ <p>This option has been replaced by the <em>cache_miss_revalidate</em> feature.
</descrip>
<tag>external_refresh_check</tag>
<p>Not yet ported from 2.7
- <tag>ignore_ims_on_miss</tag>
- <p>Not yet ported from 2.7
-
<tag>location_rewrite_access</tag>
<p>Not yet ported from 2.6
int check_hostnames;
int allow_underscore;
int via;
+ int cache_miss_revalidate;
int emailErrData;
int httpd_suppress_version_string;
int global_internal_static;
debugs(3, DBG_CRITICAL, "WARNING: url_rewrite_concurrency upgrade overriding url_rewrite_children settings.");
Config.redirectChildren.concurrency = cval;
}
+
+ if (!strcmp(name, "ignore_ims_on_miss")) {
+ // the replacement directive cache_revalidate_on_miss has opposite meanings for ON/OFF value
+ // than the 2.7 directive. We need to parse and invert the configured value.
+ int temp = 0;
+ parse_onoff(&temp);
+ Config.onoff.cache_miss_revalidate = !temp;
+ }
}
/* Parse a time specification from the config file. Store the
This option is not yet supported by Squid-3.
DOC_END
-NAME: ignore_ims_on_miss
-TYPE: obsolete
-DOC_START
- This option is not yet supported by Squid-3.
-DOC_END
-
NAME: location_rewrite_program location_rewrite_access location_rewrite_children location_rewrite_concurrency
TYPE: obsolete
DOC_START
This option is not yet supported by this version of Squid-3. Please try a later release.
DOC_END
+# Options Removed in 3.3
+NAME: ignore_ims_on_miss
+TYPE: obsolete
+DOC_START
+ Remove this line. The HTTP/1.1 feature is now fully supported by default.
+DOC_END
+
# Options Removed in 3.2
NAME: ignore_expect_100
TYPE: obsolete
acts on cacheable requests.
DOC_END
+NAME: cache_miss_revalidate
+COMMENT: on|off
+TYPE: onoff
+DEFAULT: on
+LOC: Config.onoff.cache_miss_revalidate
+DOC_START
+ Whether Squid on cache MISS will pass client revalidation requests
+ to the server or tries to fetch new content for caching.
+ This is useful while the cache is mostly empty to more quickly
+ have the cache populated.
+
+ When set to 'on' (default), Squid will pass all client If-* headers
+ to the server.
+
+ When set to 'off' and if the request is cacheable, Squid will
+ remove the clients If-Modified-Since and If-None-Match headers from
+ the request sent to the server.
+DOC_END
+
NAME: always_direct
TYPE: acl_access
LOC: Config.accessList.AlwaysDirect
case HDR_IF_MODIFIED_SINCE:
/** \par If-Modified-Since:
- * append unless we added our own;
- * \note at most one client's ims header can pass through */
-
- if (!hdr_out->has(HDR_IF_MODIFIED_SINCE))
+ * append unless we added our own,
+ * but only if cache_miss_revalidate is enabled, or
+ * the request is not cacheable, or
+ * the request contains authentication credentials.
+ * \note at most one client's If-Modified-Since header can pass through
+ */
+ // XXX: need to check and cleanup the auth case so cacheable auth requests get cached.
+ if (hdr_out->has(HDR_IF_MODIFIED_SINCE))
+ break;
+ else if (Config.onoff.cache_miss_revalidate || !request->flags.cachable || request->flags.auth)
hdr_out->addEntry(e->clone());
+ break;
+ case HDR_IF_NONE_MATCH:
+ /** \par If-None-Match:
+ * append if the wildcard '*' special case value is present, or
+ * cache_miss_revalidate is disabled, or
+ * the request is not cacheable in this proxy, or
+ * the request contains authentication credentials.
+ * \note this header lists a set of responses for the server to elide sending. Squid added values are extending that set.
+ */
+ // XXX: need to check and cleanup the auth case so cacheable auth requests get cached.
+ if (hdr_out->hasListMember(HDR_IF_MATCH, "*", ',') || Config.onoff.cache_miss_revalidate || !request->flags.cachable || request->flags.auth)
+ hdr_out->addEntry(e->clone());
break;
case HDR_MAX_FORWARDS: