excessive RAM consumption - memory leak

eliott eliott at cactuswax.net
Thu Feb 21 01:56:50 MSK 2008


On 2/20/08, Todd HG <lists at ruby-forum.com> wrote:
> eliott wrote:
>  > You may try setting expires headers for your images, if they don't
>  > change very often (or at all).
>
>
> Do you have an example for setting the expire header. In the code
>  example it shows:
>
>     expires       24h;
>     expires       0;
>     expires       -1;
>     expires       epoch;
>     add_header    Cache-Control  private;
>     server_tokens off;
>
>  I'm not sure if I should be using only:
>
>     expires       24h;
>     add_header    Cache-Control  private;
>     server_tokens off;
>
>  or if I also need:
>
>     expires       0;
>     expires       -1;
>     expires       epoch;

The expires stanza tells how long the client can cache the object, or
tells a proxy how long it can cache it. So you only need one of them
(or one per location match stanzas).

Cache control private tells a proxy, for instance, that it should not
cache the object, but that a browser on an endpoint workstation can
cache it.

http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.9.1

If you wanted to let everyone cache an image forever (like maybe an
image you never expect to change), you can set expires to max.

This may reduce _some_ traffic to you, as it will allow for greater
cacheability downstream.

Take into consideration that clients may not fetch new objects if they
change though.. I would put it into a stanza based on filetype, like
specific to images that will never change.

Hope some of that info helps.





More information about the nginx mailing list