<p><em>children-idle=N</em> determines how many helper to retain as buffer against sudden traffic loads.
<p>Deprecated <em>children=N</em> in favor of <em>children-max=N</em>.
+ <tag>http_port act-as-origin</tag>
+ <p><em>act-as-origin</em> ported from 2.7.
+ This option corrects several HTTP header issues when operating as a reverse proxy and cache.
+ Notably the externally visible aging of objects stored in the server-side cache.
+
<tag>icap_send_client_ip</tag>
<p>Deprecated in favor of adaptation_send_client_ip
which applies to both ICAP and eCAP.</p>
<p>Not yet ported from 2.7
<tag>http_port</tag>
- <p><em>act-as-origin</em> not yet ported from 2.7
<p><em>urlgroup=</em> not yet ported from 2.6
<tag>ignore_ims_on_miss</tag>
unsigned int allow_direct:1; /**< Allow direct forwarding in accelerator mode */
unsigned int vhost:1; /**< uses host header */
unsigned int sslBump:1; /**< intercepts CONNECT requests */
+ unsigned int actAsOrigin:1; ///< update replies to conform with RFC 2616
unsigned int ignore_cc:1; /**< Ignore request Cache-Control directives */
int vport; /* virtual port support, -1 for dynamic, >0 static*/
s->protocol = xstrdup(token + 9);
} else if (strcmp(token, "allow-direct") == 0) {
if (!s->accel) {
- debugs(3, DBG_CRITICAL, "FATAL: http(s)_port: vport option requires Acceleration mode flag.");
+ debugs(3, DBG_CRITICAL, "FATAL: http(s)_port: allow-direct option requires Acceleration mode flag.");
self_destruct();
}
s->allow_direct = 1;
+ } else if (strcmp(token, "act-as-origin") == 0) {
+ if (!s->accel) {
+ debugs(3, DBG_IMPORTANT, "ERROR: http(s)_port: act-as-origin option requires Acceleration mode flag.");
+ } else
+ s->actAsOrigin = 1;
} else if (strcmp(token, "ignore-cc") == 0) {
#if !USE_HTTP_VIOLATIONS
if (!s->accel) {
protocol= Protocol to reconstruct accelerated requests with.
Defaults to http://.
+ act-as-origin
+ Act as if this Squid is the origin server.
+ This currently means generate new Date: and Expires:
+ headers on HIT instead of adding Age:.
+
ignore-cc Ignore request Cache-Control headers.
Warning: This option violates HTTP specifications if
#include "ipcache.h"
#include "log/Tokens.h"
#include "MemObject.h"
+#include "ProtoPort.h"
#include "SquidTime.h"
#include "StoreClient.h"
#include "Store.h"
if (EBIT_TEST(http->storeEntry()->flags, ENTRY_SPECIAL)) {
hdr->delById(HDR_DATE);
hdr->insertTime(HDR_DATE, squid_curtime);
+ } else if (http->getConn() && http->getConn()->port->actAsOrigin) {
+ // Swap the Date: header to current time if we are simulating an origin
+ HttpHeaderEntry *h = hdr->findEntry(HDR_DATE);
+ if (h)
+ hdr->putExt("X-Origin-Date", h->value.termedBuf());
+ hdr->delById(HDR_DATE);
+ hdr->insertTime(HDR_DATE, squid_curtime);
+ h = hdr->findEntry(HDR_EXPIRES);
+ if (h && http->storeEntry()->expires >= 0) {
+ hdr->putExt("X-Origin-Expires", h->value.termedBuf());
+ hdr->delById(HDR_EXPIRES);
+ hdr->insertTime(HDR_EXPIRES, squid_curtime + http->storeEntry()->expires - http->storeEntry()->timestamp);
+ }
+ if (http->storeEntry()->timestamp <= squid_curtime) {
+ // put X-Cache-Age: instead of Age:
+ char age[64];
+ snprintf(age, sizeof(age), "%ld", (long int) squid_curtime - http->storeEntry()->timestamp);
+ hdr->putExt("X-Cache-Age", age);
+ }
} else if (http->storeEntry()->timestamp <= squid_curtime) {
hdr->putInt(HDR_AGE,
squid_curtime - http->storeEntry()->timestamp);
e = http->storeEntry();
// Copy timestamp from the original entry so the 304
// reply has a meaningful Age: header.
+ e->timestampsSet();
e->timestamp = timestamp;
e->replaceHttpReply(temprep);
e->complete();