用deny_info停止squidcaching302和307

TLDR:302,307和错误页面正在被caching。 需要强制刷新的内容。

长版本:我已经设置了一个非常小的鱿鱼实例在网关上运行,不应该caching任何,但需要被单独用作基于域的网页filter。 我正在使用其他应用程序将未经身份validation的用户redirect到代理,然后使用deny_info选项将任何未列入白名单的请求redirect到login页面。 在用户validation之后,防火墙规则被放置,以便它们不再被发送到代理。

问题是,当用户点击一个网站(xkcd.com)时,他们是未经authentication的,所以他们通过防火墙redirect:

iptables -A unknown-user -t nat -p tcp --dport 80 -j REDIRECT --to-port 39135 

到这个代理在这一点上鱿鱼redirect用户login页面使用302(我也试过307,我也确保头设置为无caching和/或无存储caching控制和Pragma)。 然后,当用户login到系统时,他们得到的防火墙规则,不再指引他们到鱿鱼代理。 但是,如果他们再次访问xkcd.com,他们将获得caching的原始redirect页面,并将再次获取login页面。

任何想法如何强制这些redirect不被浏览器caching? 也许这是一个问题w /浏览器,而不是鱿鱼,但不知道如何绕过它。

下面是完整的squidconfiguration。

 # # Recommended minimum configuration: # acl manager proto cache_object acl localhost src 127.0.0.1/32 ::1 acl to_localhost dst 127.0.0.0/8 0.0.0.0/32 ::1 acl localnet src 192.168.182.0/23 # RFC1918 possible internal network acl localnet src fc00::/7 # RFC 4193 local private network range acl localnet src fe80::/10 # RFC 4291 link-local (directly plugged) machines acl https port 443 acl http port 80 acl CONNECT method CONNECT # # Disable Cache # cache deny all via off negative_ttl 0 seconds refresh_all_ims on #error_default_language en # Allow manager access only from localhost http_access allow manager localhost http_access deny manager # Deny access to anything other then http http_access deny !http # Deny CONNECT to other than secure SSL ports http_access deny CONNECT !https visible_hostname gate.ovatn.net # Disable memory pooling memory_pools off # Never use neigh cache objects for cgi-bin scripts hierarchy_stoplist cgi-bin ? # # URL rewrite Test Settings # #acl whitelist dstdomain "/etc/squid/domains-pre.lst" #url_rewrite_program /usr/lib/squid/redirector #url_rewrite_access allow !whitelist #url_rewrite_children 5 startup=0 idle=1 concurrency=0 #http_access allow all # # Deny Info Error Test # acl whitelist dstdomain "/etc/squid/domains-pre.lst" deny_info http://login.domain.com/ whitelist #deny_info ERR_ACCESS_DENIED whitelist http_access deny !whitelist http_access allow whitelist http_port 39135 transparent ## Debug Values access_log /var/log/squid/access-pre.log cache_log /var/log/squid/cache-pre.log # Production Values #access_log /dev/null #cache_log /dev/null # Set PID file pid_filename /var/run/gatekeeper-pre.pid 

我相信我可能已经find了解决办法。 经过几天和几天的努力,才发现,只有通过随机绊倒,我发现

 client_persistent_connections off server_persistent_connections off 

这个伎俩。 所以它没有太多的caching,因为它是一个单一的持续连接搞砸了。 W000T!