You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@trafficserver.apache.org by Conan <co...@gmail.com> on 2011/04/14 10:44:15 UTC

Re: how to cache object with different urls (with question mark) just once?

This plugin works for me.

I have some questions. After modifying the cacheurl.config file, I must
restart traffic_server or use "traffic_line -b".

1. Will "traffic_line -b" block the requests during "Bounce local
traffic_server"?
2. How can I improve the plugin if I want the plugin to reread the config
files when "traffic_line -x"?

2011/3/24 Mark Harrison <ma...@omniti.com>

> > This meas that evey modified url you want to cached you have to write
> into
> > this file?
>
> > For example, i have a url like http://example.com/a.jpg?id=xxx, if i
> want
> > cache this object, does mean i have to wirte  patterns/replacements
> > in cacheurl.config?
>
> Yes, the file specified a list of URLs and what you want the cache key
> to be. In your case if you just wanted to strip off the query string
> you could probably do something like:
>
> http://example.com/([^?]*)\? http://example.com/$1
>
> This would replace http://example.com/foo.jpg?some=1&query=2&string=3
> with simply http://example.com/foo.jpg
>
> (I've not tested this and it might need a little tweaking)
>
> > it's possible use your plugin to catche some  unforeseeable modified url
> ?
>
> I'm not sure what you mean by this. You need to specify (via patterns)
> which URLs you wish to consider the same. You can however use regular
> expressions to match a group of URLs as in the example above where
> anything in example.com is matched, and it will ignore the query
> string for the purposes of matching.
>
> The other use case for this plugin is for when you have multiple
> mirrors of the same content - e.g. http://server1.example.com/foo.jpg,
> http://server2.example.com/foo.jpg. You can make a pattern such as:
>
> http://server[12].example.com/(.*)
> http://server.example.com.ATSINTERNAL/$1
>
> (The ATSINTERNAL here is simply something so that if
> http://server.example.com/foo.jpg exists, but has different content
> from http://server1.example.com/foo.jpg, then ATS doesn't consider
> them to be the same. Any unique string could be used here).
>
> Mark
>