Mantis Bugtracker

Viewing Issue Simple Details Jump to Notes ] View Advanced ] Issue History ] Print ]
ID Category Severity Reproducibility Date Submitted Last Update
0000279 [Resin] minor always 06-20-05 00:00 01-26-06 15:23
Reporter user241 View Status public  
Assigned To ferg
Priority normal Resolution fixed  
Status closed   Product Version
Summary 0000279: proxy caching for included jsp's doesn't always work
Description RSN-314
i am not sure how provide evidence of this problem other than giving you are entire web application. essentially, for some reason, certain jsps do not get cached by resin. these files are being generated called as includes, eg:

request.getRequestDispatcher(includeURI).include(request, response);

the pattern is hard to nail down, except that:
1. generally, small jsps always get cached. the same file/jsp that has a larger size (eg. more records on the screen) will not get cached, but there is no fixed size where things stop getting cached - it seems to be dependent upon the particular jsp.
2. the complexity of the page seems to make a difference - a very large page that is just a dump of html will get cached (into the megabytes), whereas a smaller page (say 15k) that has lots of java scriplets, etc in it won't get cached.

i have tried the cache max-entry-size parameter to no avail. (what is it's default anyways??).
it seems like something in the processing of a jsp is causing the page to marked as 'dirty' or non-cacheable or something.

in resin 2.x, all of my included jsp's get cached as expected and behave correctly.

Additional Information 3.x pro.
Attached Files

- Relationships

- Notes
06-20-05 00:00

i should have listed this bug as a high priority. it's a show stopper for migrating to resin 3.
06-20-05 00:00

after further testing, i have discovered that of those pages that are sensitive to a size, the cutoff point is 16384 exactly i.e. 16k. anything larger than this size will not get cached by resin.
06-20-05 00:00

i have whittled this issue down to the following:

if more than 16k (16384 bytes exactly) of data is written out to bodyContent.getEnclosingWriter() from within the doAfterBody method of a tag then the page won't cache. eg.

    public int doAfterBody() throws JspException {

          BodyContent bc = getBodyContent();
          bc.getEnclosingWriter().print(something bigger than 16k);

if instead i store the contents to a instance variable and then write the contents out from doEndTag then it works!!

    public int doEndTag() throws JspException {

        try {
        } catch (IOException e) {
            e.printStackTrace(); //To change body of catch statement use File | Settings | File Templates.

        return EVAL_PAGE;

I have coded a work around as seen in the attached file, but it looks like there is definitely a bug in the enclosing writer's when handling tag bodies.
01-26-06 15:23


- Issue History
Date Modified Username Field Change
06-20-05 00:00 user241 New Issue
01-26-06 15:23 ferg Note Added: 0000791
01-26-06 15:23 ferg Assigned To  => ferg
01-26-06 15:23 ferg Status acknowledged => closed
01-26-06 15:23 ferg Resolution open => fixed
01-26-06 15:23 ferg version 3.0.13 =>
01-26-06 15:23 ferg Fixed in Version  => 3.0.18

Mantis 1.0.0rc3[^]
Copyright © 2000 - 2005 Mantis Group
42 total queries executed.
31 unique queries executed.
Powered by Mantis Bugtracker