Re: a general question

From: Henrik Nordstrom <hno@dont-contact.us>
Date: Wed, 25 Apr 2001 23:31:59 +0200

Songqing Chen wrote:

> > Because the core expects to have a StoreEntry, and errors are also
> > negatively cached in memory.
>
> So what is the usage for this? to let the successive request know that is not cached
> or ....?

Why negatively cached? So the next request knows there is an error. See
also negative_ttl in squid.conf.

> > * Interface for finding objects in the cache
>
> This is the part I am reading. Seems hash key is used to search by storeGetPublic,
> (btw, I don't quite understand when to use the private and/or public key?), and
> hash_looup is used to search, right?

This is one of the areas where things are a bit of a moving target.
Currently you call storeGetPublicByRequest (or storeGetPublic if you
don't have a full request structure) to get a reference to the
StoreEntry of the object.

The private/public thing is quite simple. Objects start out as private,
and when it is known that the object may be shared a public key set so
other requests may find the same object. The private key is just a
unique key.

Unless you are writing something that needs to store new objects in the
cache private/public issue is not something need to bother about.

> > * Interface for protocols to store information
>
> > * Interface used to control removal policies
>
> I want to know more about these two parts. Frist one first.

Storing is basically:

storeAppend (or any of it's friends such as storeAppendPrintf) as data
is received.

When it is known that the object may be shared, call
storeSetPublicKey().

When all data has been appended, storeComplete().

Removal policies:

See the Squid programmers guide. It has it's own section there.

> > * Interface to read data
>
> Why the pack is used when sending data? Though there is some explaination, I am not
> quite clear.

Are you talking about the header part here?

Internally Squid stores HTTP headers in parsed format. When sending the
reply to the client Squid needs to pack the parsed format into a TCP
stream.

Currenly Squid does a bit too much header processing (parse, pack and
send to client_side.c, parse again, pack again and send to client..) but
there is a goal to cut this down considerably.
 
> > And please keep discussions on squid-dev@squid-cache.org, the list
> > existing for the sole purpose of discussion about the Squid code.
>
> Thanks for your kind help, should I subscribe to the squid-dev@squid-cache.org so
> that I can query and get more informaiton? (I had thought it is for the proficient
> developers.)

squid-dev is for discussions about Squid code, open for anyone who likes
to discuss the subject. You do not need to be a subscriber to post
messages there, but it helps if you want to take an active part in the
code design, programming, documentation or thinking...

--
Henrik Nordstrom
Squid Hacker
Received on Wed Apr 25 2001 - 17:05:50 MDT

This archive was generated by hypermail pre-2.1.9 : Tue Dec 09 2003 - 16:13:49 MST