You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@trafficserver.apache.org by Nelson Perez <bi...@gmail.com> on 2011/02/22 20:14:41 UTC

Accessing files stored in cache.db

Hi there. Since the last couple of weeks I've been playing around with
Traffic Server. I've compiled and installed the 2.1.5 unstable version and
started to learn more about it.
I'm more interested in caching video being sent via HTTP than any other
media, so I wrote this into my cache.config:

dest_ip=0.0.0.0-255.255.255.255 sufix=.gif action=never-cache
dest_ip=0.0.0.0-255.255.255.255 sufix=.jpg action=never-cache
url_regex=.mp4? revalidate=6h

The thing that puzzles me the most however is that the cache seems to be
kept lock down in this cache.db file. I could check that some videos must be
there since the Cache Inspector utility gives me a hit when I try something
with a regular expression like "mp4". But I would really like to check it
out myself. So, is there any way to inspect more closely this cache.db file?
by the name I would say it looks like a sqlite3 database, but I must be
wrong.

Thanks
Nelson

Re: Accessing files stored in cache.db

Posted by Leif Hedstrom <zw...@apache.org>.
On 02/22/2011 12:14 PM, Nelson Perez wrote:
>
> The thing that puzzles me the most however is that the cache seems to be
> kept lock down in this cache.db file. I could check that some videos must be
> there since the Cache Inspector utility gives me a hit when I try something

Not sure I understand this. You asking why the object is still in cache 
even though it's expired ? There's no proactive "purge" of the cached 
objects, only if something is fetching it would it possibly trigger a 
revalidation or refresh.

> with a regular expression like "mp4". But I would really like to check it
> out myself. So, is there any way to inspect more closely this cache.db file?
> by the name I would say it looks like a sqlite3 database, but I must be
> wrong.

The format is Traffic Server specific. The Cache Inspector is generally 
the way to look for things in the cache, but sounds like you've already 
tried it. If you want to verify that a request could be fulfilled out of 
cache, you can test the URL, with an addition request header of 
"Cache-Control: only-if-cached". E.g.

     curl -D - o /dev/null -s -H "Cache-Control: only-if-cached" 
http://someurl.com/some/path/foo.mp4


-- Leif


Re: Accessing files stored in cache.db

Posted by Leif Hedstrom <zw...@apache.org>.
On 02/22/2011 03:27 PM, Nelson Perez wrote:
> On Tue, Feb 22, 2011 at 7:15 PM, John Plevyak<jp...@apache.org>  wrote:
>
>> What do you want to do that the cache inspector can't do?
>>
>>
> Just play the file. But I guess that Leif's hint would do, since I would be
> retrieving the file from cache and then playing it and verifying it's
> integrity locally. Later on I want to implement a memory caching solution in
> the form of a plugin.

You mean "memory only"? The disk cache has a RAM cache layered on top of 
which, and you can control the RAM size etc. separately form the disk 
cache. There is however (yet) no way of running the cache without a disk 
backing store. There is an RFE filed for that.

-- leif


RAM Only Cache was: Re: Accessing files stored in cache.db

Posted by John Plevyak <jp...@apache.org>.
Several people have been talking about a RAM-only cache, and I would like
to collect those use cases.   There is an outstanding issue:

https://issues.apache.org/jira/browse/TS-119

If folks with an interest in RAM-only caching could please put there use 
cases there
it would help ensure that such a feature would actually be of use.  Try 
to focus on
what you want to do (environment, constraints, goals) rather than how.  
Also please
say why the  current solution of just using some amount of backing disk 
similar to
"swap" space in Linux is not good enough.

Thanx,
john


On 02/22/11 14:27, Nelson Perez wrote:
> On Tue, Feb 22, 2011 at 7:15 PM, John Plevyak<jp...@apache.org>  wrote:
>
>> What do you want to do that the cache inspector can't do?
>>
>>
> Just play the file. But I guess that Leif's hint would do, since I would be
> retrieving the file from cache and then playing it and verifying it's
> integrity locally. Later on I want to implement a memory caching solution in
> the form of a plugin.
>
> Nelson
>


Re: Accessing files stored in cache.db

Posted by Nelson Perez <bi...@gmail.com>.
On Tue, Feb 22, 2011 at 7:15 PM, John Plevyak <jp...@apache.org> wrote:

>
> What do you want to do that the cache inspector can't do?
>
>
Just play the file. But I guess that Leif's hint would do, since I would be
retrieving the file from cache and then playing it and verifying it's
integrity locally. Later on I want to implement a memory caching solution in
the form of a plugin.

Nelson

Re: Accessing files stored in cache.db

Posted by John Plevyak <jp...@apache.org>.
What do you want to do that the cache inspector can't do?

john


On 02/22/11 11:14, Nelson Perez wrote:
> Hi there. Since the last couple of weeks I've been playing around with
> Traffic Server. I've compiled and installed the 2.1.5 unstable version and
> started to learn more about it.
> I'm more interested in caching video being sent via HTTP than any other
> media, so I wrote this into my cache.config:
>
> dest_ip=0.0.0.0-255.255.255.255 sufix=.gif action=never-cache
> dest_ip=0.0.0.0-255.255.255.255 sufix=.jpg action=never-cache
> url_regex=.mp4? revalidate=6h
>
> The thing that puzzles me the most however is that the cache seems to be
> kept lock down in this cache.db file. I could check that some videos must be
> there since the Cache Inspector utility gives me a hit when I try something
> with a regular expression like "mp4". But I would really like to check it
> out myself. So, is there any way to inspect more closely this cache.db file?
> by the name I would say it looks like a sqlite3 database, but I must be
> wrong.
>
> Thanks
> Nelson
>