You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by Michael Avila <Mi...@sbcglobal.net> on 2005/12/21 03:51:06 UTC

[users@httpd] Caching Images

WinXP Pro SP2
Apache 2.0.55

How can I get Apache to cache just images since they will rarely change but
everything else does?

Mike


Re: [users@httpd] Caching Images

Posted by Gerry Danen <gd...@gmail.com>.
Mike,

I don't believe you will gain much with caching. XP is your bottleneck
if there is one.

Gerry

On 12/20/05, Michael Avila <Mi...@sbcglobal.net> wrote:
> The idea is to have the images be cached (even in memory if possible) so that it is super fast as I am running this on my PC that I use for other things. And I only have 1 GB of memory.
>
> It is my understanding from reading posts that mod_cache relies on the expire statement. Images will not have that so I was wondering how to cache only them. This is a phpBB forum with oscommerce. Oscommerce more than phpBB has images.
>
> Thanks.
>
> Mike
>
>
> > -----Original Message-----
> > From: jslive@gmail.com [mailto:jslive@gmail.com]On Behalf Of Joshua
> > Slive
> > Sent: Tuesday, December 20, 2005 9:53 PM
> > To: users@httpd.apache.org
> > Subject: Re: [users@httpd] Caching Images
> >
> >
> > On 12/20/05, Michael Avila <Mi...@sbcglobal.net> wrote:
> > > WinXP Pro SP2
> > > Apache 2.0.55
> > >
> > > How can I get Apache to cache just images since they will
> > rarely change but
> > > everything else does?
> >
> > Do you want apache to cache the images, or do you want the browsers to
> > cache them?  If the latter, look at mod_expires.  If the former, what
> > exactly do you hope to get from caching?  Serving static files is very
> > fast without any cache.
> >
> > Joshua.
> >
>
>
> ---------------------------------------------------------------------
> The official User-To-User support forum of the Apache HTTP Server Project.
> See <URL:http://httpd.apache.org/userslist.html> for more info.
> To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
>    "   from the digest: users-digest-unsubscribe@httpd.apache.org
> For additional commands, e-mail: users-help@httpd.apache.org
>
>



--
Gerry
http://portal.danen.org/

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


RE: [users@httpd] Caching Images

Posted by Michael Avila <Mi...@sbcglobal.net>.
Interesting! Thanks for the tips. I'll look in to it. But it does sound like I will not need it.

Thanks.

Mike


> -----Original Message-----
> From: jslive@gmail.com [mailto:jslive@gmail.com]On Behalf Of Joshua
> Slive
> Sent: Tuesday, December 20, 2005 10:04 PM
> To: users@httpd.apache.org
> Subject: Re: [users@httpd] Caching Images
> 
> 
> On 12/20/05, Michael Avila <Mi...@sbcglobal.net> wrote:
> > The idea is to have the images be cached (even in memory if 
> possible) so that it is super fast as I am running this on my PC 
> that I use for other things. And I only have 1 GB of memory.
> >
> > It is my understanding from reading posts that mod_cache relies 
> on the expire statement. Images will not have that so I was 
> wondering how to cache only them. This is a phpBB forum with 
> oscommerce. Oscommerce more than phpBB has images.
> 
> mod_cache will also cache based on Last-Modified headers, which all
> static files will have.  But you can also add expires headers with
> mod_expires.
> 
> But really, caching static images in this way is going to save you
> very very little.  Assuming your OS has an efficient sendfile syscall,
> it will already be implicitly caching and doing zero-copy network
> sends on frequently-used files.  Putting mod_cache in front of that
> will not make a noticable difference unless you are trying to fill an
> extremely big network pipe.
> 
> You can also look at mod_file_cache
> http://httpd.apache.org/docs/2.2/mod/mod_file_cache.html
> But you should really test this under load, because depending on the
> details of your setup, ordinary sendfile-based serving could be
> faster.
> 
> Joshua.
> 


---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] Caching Images

Posted by Joshua Slive <jo...@slive.ca>.
On 12/20/05, Michael Avila <Mi...@sbcglobal.net> wrote:
> The idea is to have the images be cached (even in memory if possible) so that it is super fast as I am running this on my PC that I use for other things. And I only have 1 GB of memory.
>
> It is my understanding from reading posts that mod_cache relies on the expire statement. Images will not have that so I was wondering how to cache only them. This is a phpBB forum with oscommerce. Oscommerce more than phpBB has images.

mod_cache will also cache based on Last-Modified headers, which all
static files will have.  But you can also add expires headers with
mod_expires.

But really, caching static images in this way is going to save you
very very little.  Assuming your OS has an efficient sendfile syscall,
it will already be implicitly caching and doing zero-copy network
sends on frequently-used files.  Putting mod_cache in front of that
will not make a noticable difference unless you are trying to fill an
extremely big network pipe.

You can also look at mod_file_cache
http://httpd.apache.org/docs/2.2/mod/mod_file_cache.html
But you should really test this under load, because depending on the
details of your setup, ordinary sendfile-based serving could be
faster.

Joshua.

RE: [users@httpd] Caching Images

Posted by Michael Avila <Mi...@sbcglobal.net>.
The idea is to have the images be cached (even in memory if possible) so that it is super fast as I am running this on my PC that I use for other things. And I only have 1 GB of memory.

It is my understanding from reading posts that mod_cache relies on the expire statement. Images will not have that so I was wondering how to cache only them. This is a phpBB forum with oscommerce. Oscommerce more than phpBB has images.

Thanks.

Mike


> -----Original Message-----
> From: jslive@gmail.com [mailto:jslive@gmail.com]On Behalf Of Joshua
> Slive
> Sent: Tuesday, December 20, 2005 9:53 PM
> To: users@httpd.apache.org
> Subject: Re: [users@httpd] Caching Images
> 
> 
> On 12/20/05, Michael Avila <Mi...@sbcglobal.net> wrote:
> > WinXP Pro SP2
> > Apache 2.0.55
> >
> > How can I get Apache to cache just images since they will 
> rarely change but
> > everything else does?
> 
> Do you want apache to cache the images, or do you want the browsers to
> cache them?  If the latter, look at mod_expires.  If the former, what
> exactly do you hope to get from caching?  Serving static files is very
> fast without any cache.
> 
> Joshua.
> 


---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] Caching Images

Posted by Joshua Slive <jo...@slive.ca>.
On 12/20/05, Michael Avila <Mi...@sbcglobal.net> wrote:
> WinXP Pro SP2
> Apache 2.0.55
>
> How can I get Apache to cache just images since they will rarely change but
> everything else does?

Do you want apache to cache the images, or do you want the browsers to
cache them?  If the latter, look at mod_expires.  If the former, what
exactly do you hope to get from caching?  Serving static files is very
fast without any cache.

Joshua.