Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 83B92200CEE for ; Tue, 8 Aug 2017 04:57:29 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 821BC1669F1; Tue, 8 Aug 2017 02:57:29 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id C86561669EE for ; Tue, 8 Aug 2017 04:57:28 +0200 (CEST) Received: (qmail 40211 invoked by uid 500); 8 Aug 2017 02:57:27 -0000 Mailing-List: contact dev-help@tomcat.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "Tomcat Developers List" Delivered-To: mailing list dev@tomcat.apache.org Received: (qmail 40191 invoked by uid 99); 8 Aug 2017 02:57:27 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 08 Aug 2017 02:57:27 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 7BA43F324F; Tue, 8 Aug 2017 02:57:27 +0000 (UTC) From: zemian To: dev@tomcat.apache.org Reply-To: dev@tomcat.apache.org References: In-Reply-To: Subject: [GitHub] tomcat issue #72: Fix https://bz.apache.org/bugzilla/show_bug.cgi?id=59901 Content-Type: text/plain Message-Id: <20170808025727.7BA43F324F@git1-us-west.apache.org> Date: Tue, 8 Aug 2017 02:57:27 +0000 (UTC) archived-at: Tue, 08 Aug 2017 02:57:29 -0000 Github user zemian commented on the issue: https://github.com/apache/tomcat/pull/72 Hi Mark, > Tomcat provides (by default) a static content cache in the resources layer so I do wonder if there is much benefit in caching the content in the JSP engine as well. Are you referring to `org.apache.catalina.webresources.Cache`? To me this enhancement is at jasper level, so I thought it make more sense to keep it self contained. Also, is okay to bring catalina classes into jasper package? But any rate, if you do decide we go this route, please confirm and I will look into it more. > The proposed cache appears to be unbounded which is likely to be a problem for larger installations. Also, there is no need to cache the JSP content once it has been processed. I thought about this, but my current proposed cache is already bounded by `ParserController` instance, and it is already per request only. You still think we should limit cache further? If we do this, then we add much more complexity to caching though. Please confirm if we need this. > My original thinking was more along the lines of some refactoring to allow re-use of a single buffered input stream with some limit on the buffer size that could mean the stream did need to be re-opened for large JSPs. I am not clear on this suggestion yet. Do tell me more if you strongly feel that's more the right direction. My current proposed solution is to cache the jsp file content as char array, then re-feed into different Stream/Reader that is used by jasper parser. The previous code will perform two reads per single jsp file processing: once for `ParserController#parseDirectives` and another for `JspDocumentParser#parse`. The proposed code will reduce these to one file read only. --- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastructure@apache.org or file a JIRA ticket with INFRA. --- --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org For additional commands, e-mail: dev-help@tomcat.apache.org