Hightower Posted October 20, 2009 Posted October 20, 2009 We use Squid here, and needed a way to view which sites were being loaded from the cache, and which sites weren't and were therefore downloaded a fresh. Is there any way to view this info? And to compare cached/new sites? Cheers,
mjs_mjs Posted October 21, 2009 Posted October 21, 2009 (edited) I no this can be done but not sure how. The obvious one is that some sites are told not to use the proxy (defined in your brouser/OS settings) so are not cached, but some are sent thought the proxy but not cached there. It may help to post a note on the Squid-users mailing list, Amos Jeffries is usually a fountain of all knoledge when it comes to Squid. Edited October 21, 2009 by mjs_mjs spelling mistakes
ind1ekid Posted October 21, 2009 Posted October 21, 2009 Would webalizer or some other log analyzer provide what you what? Then based on your findings you could create an ACL to deny caching of a specified list of sites?
Hightower Posted October 21, 2009 Author Posted October 21, 2009 Basically, the reason I ask is because our website is now our homepage and bandwidth is going through the roof because it loads for every user when they load IE. I wanted to make certain our website was loading from the cache instead of a new copy each time, thus reducing bandwidth?
ind1ekid Posted October 21, 2009 Posted October 21, 2009 I see Is your site hosted externally? The caching features aren't something I ever properly got my head round tbh, wish I could be more help. I only ever managed to set a list of sites for squid to not cache. My primary use of squid is for the filtering. The command below will give you some of the cache manager info, it will tell you a little bit about whats going on. squidclient mgr:info You need squidclient installed for it, you can apt-get squidclient too if you on debian! Squid: The Definitive Guide - Pretty good manual for squid there if you have the time to trawl through it.
Geoff Posted October 21, 2009 Posted October 21, 2009 If your website is generating dynamic content, for example it's written in PHP, then it will send the no-cache cache control header all the time. Additionally it will set pages to expire in the past. Thus Squid will not cache the site at all. Hence your bandwidth issue. Although slightly evil, you can override this behavior. The magic squid configuration command is 'refresh-pattern'. squid : refresh_pattern configuration directive I would need to know what version of squid you are running to tell you exactly what to use, as there were a lot of improvements made to the refresh-pattern configuraiton directive between 2.STABLE and 3.1!
Hightower Posted October 22, 2009 Author Posted October 22, 2009 Different topic but still related to Squid.... Our net is whitelisted for pupils, so we already had an ACL for 'allowedsites' and I've just added an ACL for 'deniedsites'. We have MTV . COM in our allowed sites, but when I added this site to denied sites it blocked the site - ideal. This is what I wanted it to do.... kind of. MTV . COM is in our allowed sites, but I want to block MTV . COM / GAMES so all of MTV is accessible apart from the games. I've tested the denied file to work (i.e. when I add a site it is tested to block that site), but when I add this domain with the /GAMES it doesn't block it. I may have over complicated this actually - just trying to give you an idea of my setup. So basically I want to allow MTV apart from /GAMES. Any help?
ind1ekid Posted October 22, 2009 Posted October 22, 2009 Different topic but still related to Squid.... Our net is whitelisted for pupils, so we already had an ACL for 'allowedsites' and I've just added an ACL for 'deniedsites'. We have MTV . COM in our allowed sites, but when I added this site to denied sites it blocked the site - ideal. This is what I wanted it to do.... kind of. MTV . COM is in our allowed sites, but I want to block MTV . COM / GAMES so all of MTV is accessible apart from the games. I've tested the denied file to work (i.e. when I add a site it is tested to block that site), but when I add this domain with the /GAMES it doesn't block it. I may have over complicated this actually - just trying to give you an idea of my setup. So basically I want to allow MTV apart from /GAMES. Any help? A url_regex acl will do the job for you. acl games1 url_regex -i "/etc/squid/acl/gameurls.list" http_access deny all games1 Add your sites to the list and your sorted 1
Hightower Posted October 22, 2009 Author Posted October 22, 2009 A url_regex acl will do the job for you. acl games1 url_regex -i "/etc/squid/acl/gameurls.list" http_access deny all games1Add your sites to the list and your sorted Care to explain what url_regex -i does?
powdarrmonkey Posted October 22, 2009 Posted October 22, 2009 Says 'use this file as input, it is a list of regular expressions'
ind1ekid Posted October 22, 2009 Posted October 22, 2009 My explanations are poor, so have a read here About a third of the way down: ViSolve - Squid Configuration Manual Has a nice example too!
tom_newton Posted October 22, 2009 Posted October 22, 2009 Sorry to weigh in late-doors on the cacheability issue - but this might help: Cacheability Query 1
Hightower Posted October 23, 2009 Author Posted October 23, 2009 A url_regex acl will do the job for you. acl games1 url_regex -i "/etc/squid/acl/gameurls.list" http_access deny all games1Add your sites to the list and your sorted Awesome - that worked a treat. Many thanks!
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now