[squid-users] pages not being cached

Eliezer Croitoru eliezer at ngtech.co.il
Thu Mar 10 14:43:59 UTC 2016


Hey Cindy,

I do not have too much experience with MediaWIKI but I ran some test on 
it in the past for both caching and other things.
I am using this logformat to detect couple things that are related to 
caching:
logformat cache_headers %ts.%03tu %6tr %>a %Ss/%03>Hs %<st %rm %ru %[un 
%Sh/%<a %mt Q-CC: "%{Cache-Control}>h" "%{Cache-Control}>ha" Q-P: 
"%{Pragma}>h" "%{Pragma}>ha" REP-CC: "%{Cache-Control}<h" REP-EXP: 
"%{Expires}<h" VARY: "%{Vary}<h" %>eui
access_log daemon:/var/log/squid/access.log cache_headers

The headers:
Cache-Control: s-maxage=18000, must-revalidate, max-age=0

clearly states that the response should not be cached by the client but 
supposed to be cached by a surrogate.
How do you test caching? wget? curl? script? netcat? a desktop browser?

Eliezer

On 10/03/2016 16:22, 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
> cache_peer 127.0.0.1 parent 8080 no-query originserver login=PASS
>
>   * Squid also listens on 127.0.0.1:80 <http://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 <http://127.0.0.1:80> defaultsite=<server name> vhost
>
>   * Apache is listening on 127.0.0.1:8080 <http://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 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
>
> I am suspicious why the last line says port 80 rather than 8080, but I'm
> not sure if that is relevant.
>
> Please let me know if there is an more relevant information that will
> help to troubleshoot this. Thank you in advance for your assistance!
>
> Cindy
>
>
> _______________________________________________
> squid-users mailing list
> squid-users at lists.squid-cache.org
> http://lists.squid-cache.org/listinfo/squid-users
>



More information about the squid-users mailing list