Why not use this algorithm:

1) check if you have local cached copy, and if the date on it is within xx
hours
2) if available, return it.
3) if not, retrieve remote copy.

You may have issues with multiple requests hitting at the same time, but
otherwise, this seems like it should be doable on almost any platform.

Memcached would be an even better solution, but might introduce more latency
(the tradeoff would be that you could cache other things later and scale it
out very easily). You could test quickly beforehand to see which is faster.

Jade

Jade Rubick
Director of Development
Truist
120 Wall Street, 4th Floor
New York, NY USA
jrub...@truist.com
+1 503 285 4963
+1 707 671 1333 fax

www.truist.com


The information contained in this email/document is confidential and may be
legally privileged. Access to this  mail/document by anyone other than the
intended recipient(s) is unauthorized. If you are not an intended recipient,
any disclosure, copying, distribution, or any action taken or omitted to be
taken in reliance to it, is prohibited.


On Mon, Apr 6, 2009 at 7:36 PM, Mark Aufflick
<mark-aolser...@aufflick.com>wrote:

> Hi Janine,
>
> There's no reason you can't run *another* apache instance, just like
> you would run a squid instance, in front of the existing tomcat/apache
> instance. You would set up this new apache instance as a caching
> proxy. Squid or pound might be a little faster, but in crazy setups
> like this you get a lot of flexibility using apache.
>
> The tomcat/apache integration, as you say, is pretty minimal. So you
> could also skip the intermediate apache completely to get this sort of
> setup:
>
> * Tomcat running standalone (on, say, localhost port 8000).
> * Apache, running as a caching reverse proxy using mod_cache,
> mod_proxy and mod_rewrite, listening on port 80, forwarding the
> requests to port 8000.
>
> This is exactly the same setup you would use if you wanted a caching
> apache proxy to sit in front of aolserver instances.
>
> As Bas says, memcached is a great solution, but that would require
> code changes to the java code which may be unpalatable :)
>
> Mark.
>
> On Tue, Apr 7, 2009 at 3:04 AM, Janine Sisk <jan...@furfly.net> wrote:
> > I have a really screwy setup and am looking for some advice.
> >
> > I have an AOLserver site running a not-very-recent version of OpenACS
> with a
> > custom CMS I did not write.  It serves up a site written entirely in
> > Traditional Chinese.   I also have a java servlet which takes a page from
> > that site and translates it into Simplified Chinese.  So URLs are like
> this:
> >
> > Traditional - http://big5.mysite.com/public/index
> > Simplified - http://gb.mysite.com/gate/gb/big5.mysite.com/public/index
> >
> > The latter goes to a Tomcat site which requests the specified page from
> > big5.mysite.com, translates it, and returns it.
> >
> > As you can imagine, this is not fast.  I'm working on convincing the
> client
> > that what we really need to do is make a static HTML version of the
> > Simplified site, which gets updated when they update content, and serve
> that
> > directly.  Ultimately I'm pretty sure that's what we'll end up doing.
>  But
> > first I have a tech guy on their end who thinks caching is the way to go,
> > and I need to try that before they'll let me implement my own solution.
> >
> > He thought I should just slap Apache in front of all this and use
> mod_cache,
> > but that was a dead end.  Since Apache  doesn't actually serve any
> content
> > in this scenario but merely hands off to Tomcat, there is nothing for it
> to
> > cache.
> >
> > I've done some googling on Tomcat and caching but there don't seem to be
> any
> > add-ons for it.  They say it does some caching by default but I'm not
> seeing
> > it, maybe because I'm not using any JSPs.  This is my first foray into
> Java
> > programming so it's all new to me.
> >
> > I know that some people use Squid as a caching proxy in front of
> AOLserver,
> > but I'm not sure if that would solve my problem or not.
> >
> > Any suggestions out there?
> >
> > thanks,
> >
> > janine
> >
> > ---
> > Janine Sisk
> > President/CEO of furfly, LLC
> > 503-693-6407
> >
> >
> > --
> > AOLserver - http://www.aolserver.com/
> >
> > To Remove yourself from this list, simply send an email to
> > <lists...@listserv.aol.com> with the
> > body of "SIGNOFF AOLSERVER" in the email message. You can leave the
> Subject:
> > field of your email blank.
> >
>
>
>
> --
> Mark Aufflick
>  contact info at http://mark.aufflick.com/about/contact
>
>
> --
> AOLserver - http://www.aolserver.com/
>
> To Remove yourself from this list, simply send an email to <
> lists...@listserv.aol.com> with the
> body of "SIGNOFF AOLSERVER" in the email message. You can leave the
> Subject: field of your email blank.
>


--
AOLserver - http://www.aolserver.com/

To Remove yourself from this list, simply send an email to 
<lists...@listserv.aol.com> with the
body of "SIGNOFF AOLSERVER" in the email message. You can leave the Subject: 
field of your email blank.

Reply via email to