Squid has numerous settings that limit the size of cached objects, the size of client requests, and the types of pages to cache. They can be used to stop the server from storing enormous files (such as downloaded ISO images), to limit the size of files that clients can upload or download, and to prevent the cache of pages that change frequently (such as those generated by CGI scripts). The defaults will generally work fine, with the possible exception of the maximum upload size, which is only 1 MB.
To edit caching options, follow these steps:
1. | Click on the Cache Options icon on the main page to display the Cache Options form (from Figure 44.3) again. |
2. | |
3. | |
4. | |
5. | As well as caching downloaded files, Squid will remember error messages from servers and return them to clients that request the same page. You can change the amount of time that errors are cached by entering a number and selecting Units in the Failed request cache time field. If Default is chosen, errors will be cached for 5 minutes. Even this can be annoyingly long, however, if you have just fixed an error on a website. |
6. | Squid will cache the responses to hostname lookups to reduce the amount of DNS activity, regardless of the TTLs that the DNS servers supply. If Default is selected in the DNS lookup cache time field, responses will be remembered for 6 hours. If this seems too long for you, select the second radio button and enter your own cache time instead. |
7. | The Don't cache URLs for ACLs field can be used to completely prevent caching for certain URLs, web servers, or clients. Any request that matches one of the ACLs checked in this field will never be cached, and thus will always be fetched directly. You can use this feature to block the caching of dynamically generated pages by creating a URL Path Regexp
ACL for .cgi or cgi-bin and selecting it here. See Section 44.6 “Introduction to Access Control Lists” for more details on how ACLs work and can be defined. |
8. | Hit the Save button at the bottom of the page to return to the main menu. Because some additional caching options are on the memory and disk usage form, click on the Memory Usage icon to display it |
9. | To limit the amount of memory that Squid will use, fill in the Memory usage limit field. Note that this limit only affects the maximum memory used for storing in-transit and frequently accessed files and negative responses. Because Squid uses memory for other purposes, it will certainly consume more than whatever you enter here. If Default is selected, a limit of 8 MB will be enforced, which is probably too low for a busy server. |
10. | |
11. |
18.117.8.216