The plugin was complete and working for 2.1.4, but there have been a number of API changes since then. I'll work on getting it built against 2.1.6 and mail a link to the code here.
Currently the plugin takes a list of regex/replacement pairs which is apples to all URLs, and changes the URL that they're cached under. Hopefully that should cover most people's use cases. A couple of examples: http://example.com/(.+)\?.* http://example.com/$1 http://server[1-4].example.com/(.*)?id=([0-9]+) http://test.ATSINTERNAL/$1_$2 this works with any part of the URL, including the query string, and was inspired by the store_url feature in a past version of squid. 2011/3/21 ChangCheng <[email protected]>: > Hi, Mark > I am working on this plugin as well. but i still haven't find better way to > solve this problem. could you give some suggestion for this problem if > possible? > Thanks lots > >> From: [email protected] >> Date: Mon, 21 Mar 2011 13:52:35 -0400 >> Subject: Re: how to cache object with different urls (with question mark) >> just once? >> To: [email protected] >> >> I've been working on a plugin that does just that, but it hasn't yet >> been updated to work with anything past 2.1.4 (It's on my todo list). >> However, I seem to remember somebody else also working on this also >> which may be further along. Let me know if you'd be interested in the >> code for the plugin. >> >> Regards, >> >> Mark >> >> On Mon, Mar 21, 2011 at 1:46 PM, Leif Hedstrom <[email protected]> wrote: >> > On 03/21/2011 11:13 AM, Conan wrote: >> > >> > hi users, > &g t; > >> > >> > I have a object to cache. This object's url is like >> > "http://example.com/a.jpg?id=xxx". The parameters after question mark(?) >> > is >> > different and dynamic, but the object is identical so it's better to >> > cache >> > only one copy of the object. >> > What I except is: ATS ignore the parameters in url and serve the object >> > (if >> > cached), or pass the complete url to original server if the object is >> > not >> > cached. >> > >> > When I enable "proxy.config.http.cache_urls_that_look_dynamic", it >> > seemed >> > ATS treated these urls as different objects. If I disable it, ATS did >> > not >> > cache any urls with question mark. >> > Any suggestions? Or what kind of plugin could I write to support that? >> > >> > You'd have to write a plugin that calculates a different cache key, >> > based on >> > your "normalization" rules. In your case, presumably only the host and >> > the >> > path. >> > >> > -- Leif >> > >> > >
