[squid-users] Caching URLs with a ? in them?
I have a bunch of static content with appropriate Expires headers, but the URL contains a "?serial=123456" where the serial number is dynamic. Is squid smart enough to ignore the fact that the URL looks like a dynamic request, and use the expire headers to see that it's indeed static/cacheable content? -- Scott Baker - Canby Telcom System Administrator - RHCE - 503.266.8253
Re: [squid-users] Caching URLs with a ? in them?
On 13/02/2013 10:48 a.m., Scott Baker wrote: I have a bunch of static content with appropriate Expires headers, but the URL contains a "?serial=123456" where the serial number is dynamic. Is squid smart enough to ignore the fact that the URL looks like a dynamic request, It *is* a dynamic request. Look see ... the URL is constantly changing. and use the expire headers to see that it's indeed static/cacheable content? Expires is relative to the URL. So if the URL changed its a *new* object (MISS) with new Expiry details. Get the picture? see http://wiki.squid-cache.org/ConfigExamples/DynamicContent for teh configuration directives to change for cachign these responses. If you have a new install of Squid-3.1 or later the default settings will cache them. However, once you have them cached, you will probably still see a lot of MISS happening because the URL are changing. For best cache HIT rate you need to look at why those serial exist at all in the URL. They are breaking the cacheability for you and everyone else on the Internet. Do you have control over the origin server generating those URLs? If you could explain what the serial is for exactly perhapse we could point you in the direction of fixing the object cacheability. Amos
Re: [squid-users] Caching URLs with a ? in them?
On 02/12/2013 04:51 PM, Amos Jeffries wrote: >> I have a bunch of static content with appropriate Expires headers, but >> the URL contains a "?serial=123456" where the serial number is dynamic. >> Is squid smart enough to ignore the fact that the URL looks like a >> dynamic request, > > It *is* a dynamic request. Look see ... the URL is constantly changing. The URL ONLY changes for logging purposes. The content being served is static. The serial number is ONLY preset so I can comb the logs and find who/when picked up a resource. >> and use the expire headers to see that it's indeed >> static/cacheable content? > > Expires is relative to the URL. So if the URL changed its a *new* object > (MISS) with new Expiry details. Get the picture? > > > see http://wiki.squid-cache.org/ConfigExamples/DynamicContent for teh > configuration directives to change for cachign these responses. If you > have a new install of Squid-3.1 or later the default settings will cache > them. > > However, once you have them cached, you will probably still see a lot of > MISS happening because the URL are changing. For best cache HIT rate you > need to look at why those serial exist at all in the URL. They are > breaking the cacheability for you and everyone else on the Internet. Do > you have control over the origin server generating those URLs? If you > could explain what the serial is for exactly perhapse we could point you > in the direction of fixing the object cacheability. -- Scott Baker - Canby Telcom System Administrator - RHCE - 503.266.8253
Re: [squid-users] Caching URLs with a ? in them?
On 2/13/2013 5:59 PM, Scott Baker wrote: The URL ONLY changes for logging purposes. The content being served is static. The serial number is ONLY preset so I can comb the logs and find who/when picked up a resource. Still the url is constantly changing and the proxy cannot know about any of the reasons you do as application developer. If you are the designing the url then consider changing this behavior. There are many solutions for your specific needs and if you are not familiar with them try to get some help about it from someone with a bit more experience in the area. It depends on your environment and application structure etc.. If you can come up with a way to describe what you want to achieve many can try to help you. Regards, Eliezer
Re: [squid-users] Caching URLs with a ? in them?
On 02/13/2013 11:48 AM, Dave Dykstra wrote: > Scott, > > If it's just for logging purposes, it would be better to use an http > header such as User-Agent rather than putting it in the URL. It is part > of the http standard to use the whole URL as a caching index. Good point... I can send a header instead. Thanks -- Scott Baker - Canby Telcom System Administrator - RHCE - 503.266.8253