Hello, I am using Squid-3.1 in acceleration mode and trying to accelerate mediawiki-1.20.2. I am trying to get squd to cache mediawiki's pages. Here is my squid config
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 web_ports port 80 acl purge method PURGE
http_access allow manager localhost http_access deny manager
http_access allow web_ports all
http_access allow purge localhost http_access deny purge
http_access deny all
http_port 10.50.79.19:80 accel defaultsite=ec2-54-228-113-248.eu-west-1.compute.amazonaws.com vhost ignore-cc cache_peer 127.0.0.1 parent 8080 0 no-query originserver round-robin name=wiki
cache_dir aufs /var/spool/squid/cache 500 16 256
refresh_pattern -i ^http: 5 100% 1440 ignore-no-cache
mediawiki is configured to use squid
// Squid $wgUseSquid = true; $wgSquidServers = array('10.50.79.19'); $wgSquidServersNoPurge = array('127.0.0.1');
But I am getting on request to main page, which is dymaically generated by mediawiki, this response headers: Cache-Control |s-maxage=18000, must-revalidate, max-age=0| Connection |close| Content-Language |ru| Content-Type |text/html; charset=UTF-8| Date |Mon, 08 Apr 2013 11:24:07 GMT| Last-Modified |Mon, 08 Apr 2013 10:43:40 GMT| Server |Apache/2.2.24 (Amazon)| Vary |Accept-Encoding,Cookie| X-Cache |MISS from ip-10-50-79-19.eu-west-1.compute.internal| X-Cache-Lookup |MISS from ip-10-50-79-19.eu-west-1.compute.internal:80| X-Content-Type-Options |nosniff| X-Powered-By |PHP/5.3.20| via |1.0 ip-10-50-79-19.eu-west-1.compute.internal (squid/3.1.10)|
so we see, that squid return result not from cache, but from the apache web server. We see coresponding records in Apache logs when cache misses.
While request to static content, like picture files return this headers Accept-Ranges |bytes| Age |15438| Connection |keep-alive| Content-Length |10204| Content-Type |text/css| Date |Mon, 08 Apr 2013 07:06:50 GMT| Etag |"227ef-27dc-4d9846436bc62"| Last-Modified |Thu, 04 Apr 2013 08:02:27 GMT| Server |Apache/2.2.24 (Amazon)| X-Cache |HIT from ip-10-50-79-19.eu-west-1.compute.internal| X-Cache-Lookup |HIT from ip-10-50-79-19.eu-west-1.compute.internal:80| via |1.0 ip-10-50-79-19.eu-west-1.compute.internal (squid/3.1.10)|
and here we see, that squid return content from the cache.
What can be the cause of cache MISS on main page ? How to get squid to actually cache mediawiki's article pages ? Thanks.
Just in addition. I just want to cache all pages of my mediawiki site, just like Wikipedia does with Squid cache.
On Mon, Apr 8, 2013 at 7:45 AM, s9gf4ult s9gf4ult@gmail.com wrote:
What can be the cause of cache MISS on main page ?
Are you logged in to the wiki? Squid will always bypass its cache for page requests from logged-in users.
Are you logged in to the wiki? Squid will always bypass its cache for page requests from logged-in users.
I has tried to login and logout, but nothing changed. I beleive cache miss becomes because of response headers
Cache-Control |no-cache, no-store, max-age=0, must-revalidate
but not sure. I would force squid to ignore this headers, but this is not right because there is special pages, which are absolutely dynamic and must not be cached.
And without caching my web server just dies on the load. |
mediawiki-l@lists.wikimedia.org