Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

Squid 2.7 always reaches backend, expected is to reach backend using stale-while-revalidate only when cache expires, not when client triggers max-age=0.

Script:

<?php

header('Cache-Control: public, max-age=10, stale-if-error=200, stale-while-revalidate=500');
header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");

sleep(2);
die("OK");

And squid config:

# http_port public_ip:port accel defaultsite= default hostname, if not provided
http_port 80 accel defaultsite=mydomain.com

# IP and port of your main application server (or multiple)
cache_peer 127.0.0.1 parent 8000 0 no-query allow-miss originserver name=main

# Do not tell the world that which squid version we're running
httpd_suppress_version_string on

# Remove the Caching Control header for upstream servers
header_access Cache-Control deny all
#header_access Last-Modified deny all

# log all incoming traffic in Apache format
logformat combined %>a %ui %un [%tl] "%rm %ru HTTP/%rv" %Hs %<st "%{Referer}>h" "%{User-Agent}>h" %Ss:%Sh
access_log /usr/local/squid/var/logs/squid.log combined all

cache_effective_user squid

refresh_pattern . 10080 90% 999999 ignore-no-cache override-expire ignore-private

icp_port 0
share|improve this question

1 Answer 1

up vote 0 down vote accepted

Solution described here: http://stackoverflow.com/questions/12846107/how-to-use-in-squid-2-7-the-3-1-feature-ignore-cc


Well, after trying all alternatives, I modified the source code to implement the feature.

I changed in the Squid-2.7-stable9 the file src/refresh.c:282:

282:    if (request) {

for

282:    if (request && FALSE) {

They do something like that in the 3.X to implement ignoreCc:

269:    if (request && !request->flags.ignore_cc) {

Worked as expected.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.