[squid-users] pages not being cached

Amos Jeffries squid3 at treenet.co.nz
Fri Mar 11 01:02:36 UTC 2016


On 11/03/2016 3:22 a.m., Cindy Cicalese wrote:
> I am using Squid for caching with Apache and MediaWiki over HTTPS only.
> Unfortunately, no pages are being cached; each request is being sent from
> Squid to Apache. I would appreciate help figuring out how to get caching to
> work.
> 
> My configuration is as follows:
> 
>    - Squid is configured to listen on <external ip>:443 for HTTPS requests
>    and forwards them to Apache on port 8080
> 
> https_port <external ip>:443 cert=<path to cert> key=<path to key>
> defaultsite=<server name> vhost

If your Squid accepts the "vhost" option without any "squid -k parse"
warnings then it is quite outdated.

Current Squid require the "accel" mode option after the ip:port and
vhost is enabled by default now.


> cache_peer 127.0.0.1 parent 8080 no-query originserver login=PASS
> 
> 
>    - Squid also listens on 127.0.0.1:80 for PURGE requests from MediaWiki
>    because I could not figure out how to configure MediaWiki to send PURGE
>    requests with HTTPS
> 
> http_port 127.0.0.1:80 defaultsite=<server name> vhost
> 
> 
>    - Apache is listening on 127.0.0.1:8080 for requests from Squid
>    - Apache is also listening on <external ip>:80 which is set up as a
>    permanent redirect to HTTPS
>    - MediaWiki is configured as follows:
> 
> $wgUseSquid = true;
> $wgSquidServers = array('127.0.0.1'); // this is where PURGE requests are
> sent
> $wgSquidServersNoPurge = array('<external ip>');
> 
> GET requests are being received by MediaWiki with Cache-Control: max-age=0

That is explicitly forbidding cached objects to be used to answer the
request.

1) How are you testing this?


> in the headers. The response sent by MediaWiki includes the following
> headers:
> 
> Cache-Control: s-maxage=18000, must-revalidate, max-age=0
> X-Cache: MISS from <server name>
> X-Cache-Lookup: HIT from <server name>:80
> 

2) what are the access.log entries you are seeing with these?


> I am suspicious why the last line says port 80 rather than 8080, but I'm
> not sure if that is relevant.
> 

Squid checks the http_port details before the https_port details when
searching for its ports.

> Please let me know if there is an more relevant information that will help
> to troubleshoot this. Thank you in advance for your assistance!
> 

Amos



More information about the squid-users mailing list