If you want Squid to cache your pages, you can set an Expires header with a date in the future, but the recommended way is to use s-maxage :. This tells Squid to cache the page for seconds s-maxage , and at the same time it tells the user's browser not to cache the page max-age - double-caching can lead to some unexpected results! Of course, this header is useless if you send out one of the non-caching headers Expires in the past, Set-Cookie , etc.
Some user-agents don't understand gzip compression, so they should get the uncompressed version. Now let's assume you have logged-in users whose pages should not be cached, whereas the pages for anonymous user should be cached. It takes load away from your HTTP server and internal network. You move the server away from port 80 or whatever your published port is , and substitute the accelerator, which then pulls the HTTP data from the "real" HTTP server only the accelerator needs to know where the real server is.
The outside world sees no difference apart from an increase in speed, with luck. Quite apart from taking the load of a site's normal web server, accelerators can also sit outside firewalls or other network bottlenecks and talk to HTTP servers inside, reducing traffic across the bottleneck and simplifying the configuration.
Two or more accelerators communicating via ICP can increase the speed and resilience of a web service to any single failure. The Squid redirector can make one accelerator act as a single front-end for multiple servers. If you need to move parts of your filesystem from one server to another, or if separately administered HTTP servers should logically appear under a single URL hierarchy, the accelerator makes the right thing happen.
If you wish only to cache the "rest of the world" to improve local users browsing performance, then accelerator mode is irrelevant. Sites which own and publish a URL hierarchy use an accelerator to improve access to it from the Internet. Sites wishing to improve their local users' access to other sites' URLs use proxy caches. Many sites, like us, do both and hence run both. Measurement of the Squid cache and its Harvest counterpart suggest an order of magnitude performance improvement over CERN or other widely available caching software.
This order of magnitude performance improvement on hits suggests that the cache can serve as an httpd accelerator, a cache configured to act as a site's primary httpd server on port 80 , forwarding references that miss to the site's real httpd on port In such a configuration, the web administrator renames all non-cachable URLs to the httpd's port This article explains how you can set up a caching reverse proxy with Squid 2.
If you have a high-traffic dynamic web site that generates lots of database queries on each request, you can decrease the server load dramatically by caching your content for a few minutes or more that depends on how often you update your content. In this guide I will call the web site that I want to cache www. I will install Squid on the same server and configure Apache to listen on port and Squid on port 80 so that all HTTP requests go to Squid which then passes them on to Apache unless it can satisfy the request from its cache.
Of course, you are free to install Squid on another system - you could then let Apache run on port Of course, the backend web server should log the original user's IP address in its access log instead of the IP address of our Squid proxy. Next we make a backup of the original squid.
0コメント