You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@trafficserver.apache.org by ChangCheng <cc...@msn.com> on 2011/03/11 18:09:50 UTC

How TS find object from object database (cache)

Hi guys:I'm glad to join this group, i'm currently a college senior student with a little extra bit of time on my hands and wanted to get a little experience with TS.Currently,I have accrued some basic knowledge through go through TS Administrator's Guide.For now, there is a  problem i can't understand, How Ts find object from object database (cache) ? in page :http://trafficserver.apache.org/docs/v2/admin/http.htm , step2 : it mentioned Using the object address, Traffic Server tries to locate the requested object in its object database (cache).. but i am not very sure what is exctly object address, it is url or hash key for url? For example, if user request www.google.com , when the TS receive request, how it find this page from database? what is key for ts check page from database? i really would like to konw the details about how TS find object from cache. Thanks  		 	   		  

Re: How TS find object from object database (cache)

Posted by John Plevyak <jp...@acm.org>.
I will answer from the point of view of the cache and perhaps someone else
could answer the more detailed HTTP/1.1
questions which are outside of my expertise.

The cache get's a hash (MD5) (of the URL after some massage I suppose, don't
quote me on that).
It looks it up in a big hash table which gives it 0 or more possible
location for the head of the
object on disk (the fragment containing the vector of headers and perhaps
the body of one
of the alternates).

If it is a "miss" it tells the HTTP state machine.

If it has a possible hit it it the HTTP state machine grabs the vector of
alternates and
compares it to the request to see if there is a match.  If there is, it
requests that object
(which might already be in the fragment that was retrieved).   It then
streams that
document to the user.   For multiple fragment documents things are a bit
more complicated.
For documents with alternates and situations where the header is updated but
not the contents
things are more complicated as well.

If you want pointers or have more specific questions I'll try to help you.
 I you want to
know about HTTP stuff, perhaps someone else can help.

Some details of the directory structure were just covered here (see an
earlier post), perhaps
in the archive if you were not subscribed.

john

2011/3/11 ChangCheng <cc...@msn.com>

>
> Hi guys:I'm glad to join this group, i'm currently a college senior student
> with a little extra bit of time on my hands and wanted to get a little
> experience with TS.Currently,I have accrued some basic knowledge through go
> through TS Administrator's Guide.For now, there is a  problem i can't
> understand, How Ts find object from object database (cache) ? in page :
> http://trafficserver.apache.org/docs/v2/admin/http.htm , step2 : it
> mentioned Using the object address, Traffic Server tries to locate the
> requested object in its object database (cache).. but i am not very sure
> what is exctly object address, it is url or hash key for url? For example,
> if user request www.google.com , when the TS receive request, how it find
> this page from database? what is key for ts check page from database? i
> really would like to konw the details about how TS find object from cache.
> Thanks