You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@httpd.apache.org by Graham Leggett <mi...@sharp.fm> on 2001/08/10 15:16:34 UTC

Re: About image processing and cache.

Carlos Costa Portela wrote:

> 1st. Build by own web-image server. Just receive requests, examine it,
> processing and return.
> 
> 2nd. Use apache for doing it.

The easiest way to do this is to use a dedicated caching layer to cache
your images. An Apache based reverse proxy can be used to do this quite
effectively (mod_proxy and the ProxyPass directive).

You could also use something like Squid cache to do this, though using
an actual webserver product allows you more flexibility in terms of
virtual host and logfile handling, etc.

You just need to make 100% sure that your image generation engine
generates the Last-Modified and Expires headers correctly, otherwise
caching will not work properly (nothing will be cached).

Regards,
Graham
-- 
-----------------------------------------
minfrin@sharp.fm		"There's a moon
					over Bourbon Street
						tonight..."

Re: About image processing and cache.

Posted by Carlos Costa Portela <cc...@servidores.net>.
On Sat, 11 Aug 2001, Tarun Upadhyay wrote:

> a) Configure all your cgi scripts for image processing to do it in GET
> directives. So your URL queries will look like:
>
> http://www.yourhost.com/processimage.cgi?image=penguin.jpg&rectangle.x=100&r
> ectangle.y=400
>
> this is probably what you intend to do, anyways.
>
> b) Configure mod_rewrite to show this to user as a direct URL (without query
> variables).
> so before mod_rewrite process the above query it may look something like:
>
> http://www.yourhost.com/processimage/penguin.jpg/rectangle/100_400
>
> c) and of course, configure your cgi script so that generated image has long
> timeout from cache
>
> This will also "aggregate" your image processing.

	If I do this, do I need put the cache and image processing layers,
as Graham said?. Are both solutions compatible?.

	Thank you very much,
		Carlos.


  http://www.improveyourweb.com : All about web, PHP-Nuke based site
             [ Web info for and from web people: enjoy it! ]

 _______Carlos Costa Portela__________________________________________
|   e-mail:  ccosta@servidores.net  |     http://www.registros.net    |
|   www: http://ccp.servidores.net  |     http://www.avisaboe.com     |
|      http://www.biologia.org      |   http://moana.servidores.net   |
|__Tódalas persoas maiores foron nenos antes, pero poucas se lembran__|


Re: About image processing and cache.

Posted by Tarun Upadhyay <ta...@induslogic.com>.
You will also need to do the following

a) Configure all your cgi scripts for image processing to do it in GET
directives. So your URL queries will look like:

http://www.yourhost.com/processimage.cgi?image=penguin.jpg&rectangle.x=100&r
ectangle.y=400

this is probably what you intend to do, anyways.

b) Configure mod_rewrite to show this to user as a direct URL (without query
variables).
so before mod_rewrite process the above query it may look something like:

http://www.yourhost.com/processimage/penguin.jpg/rectangle/100_400

c) and of course, configure your cgi script so that generated image has long
timeout from cache

This will also "aggregate" your image processing.


================
With Warm Regards
Tarun Upadhyay
http://www.tarunupadhyay.com

----- Original Message -----
From: "Graham Leggett" <mi...@sharp.fm>
To: <ne...@apache.org>
Sent: Saturday, August 11, 2001 12:25 PM
Subject: Re: About image processing and cache.


> Carlos Costa Portela wrote:
>
> > > The easiest way to do this is to use a dedicated caching layer to
cache
> > > your images. An Apache based reverse proxy can be used to do this
quite
> > > effectively (mod_proxy and the ProxyPass directive).
> >
> >         Ok. Thank you very much, Graham. Note that I don't what a simple
> > proxy, since I must do image processing; for example, I can receive a
name
> > file, and four coordinates; or paint some points in the image, etc...
>
> The image processing is done in the image processing layer, the proxy
> acts as the caching layer like this:
>
>  +---------+     +-------+     +-----------+
>  | Browser | <-- | Proxy | <-- | Image     | <-- Image
>  +---------+     | cache |     | Processor |
>                  +-------+     +-----------+
>
> The proxy cache can run on a different machine, or the same machine, or
> even be a separate virtual host on the webserver (if the image
> manipulator and the cache are both Apache).
>
> >         If I use a dedicated caching layer, 1st, where can I find info?
>
> Look in the mod_proxy docs for the ProxyPass directive, and read the
> sections in RFC2616 about the Last-Modified and Expires headers so that
> the cache is effective.
>
> > and 2nd, can I agregate image processing?
>
> I don't follow - what does this mean?
>
> Regards,
> Graham
> --
> -----------------------------------------
> minfrin@sharp.fm "There's a moon
> over Bourbon Street
> tonight..."


Re: About image processing and cache.

Posted by Carlos Costa Portela <cc...@servidores.net>.
On Mon, 13 Aug 2001, Graham Leggett wrote:
> >         And where can I find information about add the "Image Processor"
> > module, that is, information about put a layer between file and proxy
> > cache?.
>
> I was under the impression you were writing it... (I assumed what you
> were writing was a CGI...?)

	Yes, I am going to write it, but I understood you that "Image
Processor" must be a module. Ok, if it can be a cgi, it would be more easy
for me, since I've programmed cgi's for years, while my experience in
modules is limited (just a couple of modifications).

	Then, if I program a cgi (say, get_image), the chain should be
like this:

browser : get http://myhost/get_image?...
apache receive the request and pass it to a cgi
my cgi go to the file, paint the restaurants on the map, and send the info
to the browser.

	Then I must put the caching layer after cgi output.

	Best regards,
		Carlos.


  http://www.improveyourweb.com : All about web, PHP-Nuke based site
             [ Web info for and from web people: enjoy it! ]

 _______Carlos Costa Portela__________________________________________
|   e-mail:  ccosta@servidores.net  |     http://www.registros.net    |
|   www: http://ccp.servidores.net  |     http://www.avisaboe.com     |
|      http://www.biologia.org      |   http://moana.servidores.net   |
|__Tódalas persoas maiores foron nenos antes, pero poucas se lembran__|


Re: About image processing and cache.

Posted by Graham Leggett <mi...@sharp.fm>.
Carlos Costa Portela wrote:

> > The proxy cache can run on a different machine, or the same machine, or
> > even be a separate virtual host on the webserver (if the image
> > manipulator and the cache are both Apache).
> 
>         When you say "both Apache" you want to say "both Apache modules",

I was saying "served by apache somehow", which could mean modules, or
CGI, or whatever.

>         And where can I find information about add the "Image Processor"
> module, that is, information about put a layer between file and proxy
> cache?.

I was under the impression you were writing it... (I assumed what you
were writing was a CGI...?)

Regards,
Graham
-- 
-----------------------------------------
minfrin@sharp.fm		"There's a moon
					over Bourbon Street
						tonight..."

Re: About image processing and cache.

Posted by Carlos Costa Portela <cc...@servidores.net>.
On Sat, 11 Aug 2001, Graham Leggett wrote:
> The image processing is done in the image processing layer, the proxy
> acts as the caching layer like this:
>
>  +---------+     +-------+     +-----------+
>  | Browser | <-- | Proxy | <-- | Image     | <-- Image
>  +---------+     | cache |     | Processor |
>                  +-------+     +-----------+
>
> The proxy cache can run on a different machine, or the same machine, or
> even be a separate virtual host on the webserver (if the image
> manipulator and the cache are both Apache).

	When you say "both Apache" you want to say "both Apache modules",
I think. I am thinking around the dedicated caching layer, since probably
(in the future) I'll want add "pre-cache", generating subimages when the
user request an image (with sections of the image, for example). (But this
is another tale).

> >         If I use a dedicated caching layer, 1st, where can I find info?
>
> Look in the mod_proxy docs for the ProxyPass directive, and read the
> sections in RFC2616 about the Last-Modified and Expires headers so that
> the cache is effective.

	And where can I find information about add the "Image Processor"
module, that is, information about put a layer between file and proxy
cache?.

> > and 2nd, can I agregate image processing?
>
> I don't follow - what does this mean?

	What you say at the first of the email (the Image Processor
module) (Excuse my bad English).

	Thank you very much,
		Carlos.


  http://www.improveyourweb.com : All about web, PHP-Nuke based site
             [ Web info for and from web people: enjoy it! ]

 _______Carlos Costa Portela__________________________________________
|   e-mail:  ccosta@servidores.net  |     http://www.registros.net    |
|   www: http://ccp.servidores.net  |     http://www.avisaboe.com     |
|      http://www.biologia.org      |   http://moana.servidores.net   |
|__Tódalas persoas maiores foron nenos antes, pero poucas se lembran__|


Re: About image processing and cache.

Posted by Graham Leggett <mi...@sharp.fm>.
Carlos Costa Portela wrote:

> > The easiest way to do this is to use a dedicated caching layer to cache
> > your images. An Apache based reverse proxy can be used to do this quite
> > effectively (mod_proxy and the ProxyPass directive).
> 
>         Ok. Thank you very much, Graham. Note that I don't what a simple
> proxy, since I must do image processing; for example, I can receive a name
> file, and four coordinates; or paint some points in the image, etc...

The image processing is done in the image processing layer, the proxy
acts as the caching layer like this:

 +---------+     +-------+     +-----------+
 | Browser | <-- | Proxy | <-- | Image     | <-- Image
 +---------+     | cache |     | Processor |
                 +-------+     +-----------+

The proxy cache can run on a different machine, or the same machine, or
even be a separate virtual host on the webserver (if the image
manipulator and the cache are both Apache). 

>         If I use a dedicated caching layer, 1st, where can I find info?

Look in the mod_proxy docs for the ProxyPass directive, and read the
sections in RFC2616 about the Last-Modified and Expires headers so that
the cache is effective.

> and 2nd, can I agregate image processing?

I don't follow - what does this mean?

Regards,
Graham
-- 
-----------------------------------------
minfrin@sharp.fm		"There's a moon
					over Bourbon Street
						tonight..."

Re: About image processing and cache.

Posted by Carlos Costa Portela <cc...@servidores.net>.
On Fri, 10 Aug 2001, Graham Leggett wrote:

> Carlos Costa Portela wrote:
>
> > 1st. Build by own web-image server. Just receive requests, examine it,
> > processing and return.
> >
> > 2nd. Use apache for doing it.
>
> The easiest way to do this is to use a dedicated caching layer to cache
> your images. An Apache based reverse proxy can be used to do this quite
> effectively (mod_proxy and the ProxyPass directive).

	Ok. Thank you very much, Graham. Note that I don't what a simple
proxy, since I must do image processing; for example, I can receive a name
file, and four coordinates; or paint some points in the image, etc...

	If I use a dedicated caching layer, 1st, where can I find info?
and 2nd, can I agregate image processing?

	Best regards,
		Carlos.

  http://www.improveyourweb.com : All about web, PHP-Nuke based site
             [ Web info for and from web people: enjoy it! ]

 _______Carlos Costa Portela__________________________________________
|   e-mail:  ccosta@servidores.net  |     http://www.registros.net    |
|   www: http://ccp.servidores.net  |     http://www.avisaboe.com     |
|      http://www.biologia.org      |   http://moana.servidores.net   |
|__Tódalas persoas maiores foron nenos antes, pero poucas se lembran__|