Re: [Resin-interest] clearing cache manually or in code

2007-05-31 Thread Gary Zhu
First of all, Expire header and If-Modified-Since header are there to serve 2 
different purposes

There was an email in this forum that I think should address your concern, IF 
you actually follow the link and read the articles.

I dug this email up from my deleted section, and attached it here(without 
asking the permission from Lokitech).

By the way, it would be nice to keep those email discussions organized online.


> -Original Message-
> From: [EMAIL PROTECTED]
> [mailto:[EMAIL PROTECTED] Behalf Of
> Bernard Bernstein
> Sent: Thursday, May 31, 2007 12:49 PM
> To: General Discussion for the Resin application server
> Subject: [Resin-interest] clearing cache manually or in code
>
>
> We are using the Resin proxy cache by setting Expire headers on some
> files (jsp files that generate css and some javascript).
> Occasionally, we want to get a new version of these files loaded, but
> we don't want to set a short expiration time for the occasional
> change in something.
>
> For example.
>
> We might have a .jsp file that is the stylesheet, where we can set
> the font size through some frontend setting. We want that page to be
> cached most of the time, but when someone changes that font, we don't
> want them to need to wait for an hour for the cached version to
> expire before everyone sees the new font size. We also don't want the
> overhead of executing the jsp for every pageview.
>
> The jsp file itself isn't changing, so resin wouldn't necessarily
> know that the page has expired. So, is there any way we can
> programmatically clear that page cache, or all cached pages for that
> matter.
>
> Looking through archives I see discussion of adding:
>
> true
>
> to a webapp setup, but that doesn't seem to work anymore now that
> we're starting to use 3.1 (I haven't tested on 3.0 which we are using
> in production).
>
> I've also tried calling
> com.caucho.server.resin.ServletServer.clearCache() and doesn't seem
> to compile.
>
> I'm using jconsole to look at the jmx-accessible beans, but I don't
> see anything there that can help with this either.
>
> What is the modern way to clear the cache during runtime? I'm having
> some trouble finding an answer, so I thought I'd ask here.
>
> Thanks,
>
>
> Bernie
>
>
>
> ___
> resin-interest mailing list
> resin-interest@caucho.com
> http://maillist.caucho.com/mailman/listinfo/resin-interest
>
--- Begin Message ---
Jean-François,

This is the best write-up I've seen on how browsers and proxy servers
cache:

http://www.mnot.net/cache_docs/

Then once you know what you want in headers, this page is a good
discussion of the various browser and server-side caching features in
Resin 3.1:

http://www.caucho.com/resin-3.1/doc/proxy-cache.xtp

What you want is certainly very doable and hopefully straight-forward
after reading these docs.  The first site also links to an online tool
that can test whether you've got the headers working right.

--
Serge Knystautas
Lokitech >> software . strategy . design >> http://www.lokitech.com
p. 301.656.5501
e. [EMAIL PROTECTED]

Jean-Francois Lamy wrote:
> I am trying to understand how resin, apache and proxies interact with
> respect to caching.
>
> I have a jsp page which is meant to be always dynamic; headers are used to
> prevent it from being cached.
> However, the page loads js, css, and various images, which I would like to
> be cached.
>
> Currently,  the browser (IE7) requests those items, and Resin returns 304
> (up-to-date) status.  The browser is NOT set to force request at each page.
> This generates a lot of requests, which are painful when going through
> proxies.
>
> Is there a recipe for forcing the JSP to always reload (my JSPs are served
> through a dispatching servlet which does an include, and therefore servlet
> is able manipulate the headers), and yet let the browser know that the js
> and css it has in cache are just fine ?
>
> Jean-François Lamy
> Technologies Teximus inc.
> www.teximus.com
> +1 514.878.1577 (Canada)
> +33(0) 8.70.44.49.02 (Europe)
>
>
>
>
>
> ___
> resin-interest mailing list
> resin-interest@caucho.com
> http://maillist.caucho.com/mailman/listinfo/resin-interest



___
resin-interest mailing list
resin-interest@caucho.com
http://maillist.caucho.com/mailman/listinfo/resin-interest
--- End Message ---
___
resin-interest mailing list
resin-interest@caucho.com
http://maillist.caucho.com/mailman/listinfo/resin-interest


Re: [Resin-interest] clearing cache manually or in code

2007-05-31 Thread Bill Au

In 3.0.x, the server mbean has a clearCache() and a clearCacheByPattern(host,
url) method in com.caucho.server.resin.mbean.ServletServerMBean.  The name
of the mbean should be resin:type=Server,name=default

Bill

On 5/31/07, Bernard Bernstein <[EMAIL PROTECTED]> wrote:


We are using the Resin proxy cache by setting Expire headers on some
files (jsp files that generate css and some javascript).
Occasionally, we want to get a new version of these files loaded, but
we don't want to set a short expiration time for the occasional
change in something.

For example.

We might have a .jsp file that is the stylesheet, where we can set
the font size through some frontend setting. We want that page to be
cached most of the time, but when someone changes that font, we don't
want them to need to wait for an hour for the cached version to
expire before everyone sees the new font size. We also don't want the
overhead of executing the jsp for every pageview.

The jsp file itself isn't changing, so resin wouldn't necessarily
know that the page has expired. So, is there any way we can
programmatically clear that page cache, or all cached pages for that
matter.

Looking through archives I see discussion of adding:

true

to a webapp setup, but that doesn't seem to work anymore now that
we're starting to use 3.1 (I haven't tested on 3.0 which we are using
in production).

I've also tried calling
com.caucho.server.resin.ServletServer.clearCache() and doesn't seem
to compile.

I'm using jconsole to look at the jmx-accessible beans, but I don't
see anything there that can help with this either.

What is the modern way to clear the cache during runtime? I'm having
some trouble finding an answer, so I thought I'd ask here.

Thanks,


Bernie



___
resin-interest mailing list
resin-interest@caucho.com
http://maillist.caucho.com/mailman/listinfo/resin-interest

___
resin-interest mailing list
resin-interest@caucho.com
http://maillist.caucho.com/mailman/listinfo/resin-interest