From users-return-265684-archive-asf-public=cust-asf.ponee.io@tomcat.apache.org Thu Oct 4 19:10:24 2018 Return-Path: X-Original-To: archive-asf-public@cust-asf.ponee.io Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by mx-eu-01.ponee.io (Postfix) with SMTP id 0BA08180658 for ; Thu, 4 Oct 2018 19:10:23 +0200 (CEST) Received: (qmail 98239 invoked by uid 500); 4 Oct 2018 17:10:22 -0000 Mailing-List: contact users-help@tomcat.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "Tomcat Users List" Delivered-To: mailing list users@tomcat.apache.org Received: (qmail 98228 invoked by uid 99); 4 Oct 2018 17:10:22 -0000 Received: from mail-relay.apache.org (HELO mailrelay1-lw-us.apache.org) (207.244.88.152) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 04 Oct 2018 17:10:22 +0000 Received: from Christophers-MacBook-Pro-2.local (pool-108-28-160-33.washdc.fios.verizon.net [108.28.160.33]) by mailrelay1-lw-us.apache.org (ASF Mail Server at mailrelay1-lw-us.apache.org) with ESMTPSA id C2C7C1470 for ; Thu, 4 Oct 2018 17:10:21 +0000 (UTC) Subject: Re: TC 8.5 cachingAllowed=false ramifications? To: users@tomcat.apache.org References: <15302093bd3f40a7a99035b1e72c9447@CISEXCASMB02-1a.caci.com> From: Christopher Schultz Openpgp: preference=signencrypt Autocrypt: addr=chris@christopherschultz.net; prefer-encrypt=mutual; keydata= xsFNBE+pgz4BEADd7qAWgqXcNltlB3aow0UneRmNSVjHKgekgs0ZXxG9l50Athksr/3bL/yg bxFB00JcM9W+UxLhKHiMSyzfeBHn9l9wAlLFKs0S91KXTUnRwGFtvgstvGROoqPgTVREklnm yW/KpzOwqSrQ5xHcogaT+XWlXmRbtFypi52Z5HGWlFWWgwx0vKBWHmQayPtCif0v1RDxfdV9 zziodn0TnpfBQsEgf9TDAjkNT8f0ecwTnhSihTDm1W5HCK7P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xXw41P93V4Khigc5dEOG1kEDoq0dAlAE7AbL6Vzc/Go+UwivtUil3sXADOyM9PT JjLNnye+2V0ywQncJ1AG6sxICpPKzv8oYP6xwurEuKnF8DAWEHEwT+Fb277Idv1v8uMGvltp coe7olE0O+TRUtMEwtEp4g4m8ym1rJI/yfwXtHkS8QcVBA9LRqcWEna1VPlT1pk3BSq/1xQa F/4OLScBfV2JbF93sN0SLw== Message-ID: <74be6c3d-1845-68be-a6ed-a7f2db1e531a@christopherschultz.net> Date: Thu, 4 Oct 2018 13:10:21 -0400 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.13; rv:60.0) Gecko/20100101 Thunderbird/60.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA256 Cris, On 10/4/18 09:54, Mark Thomas wrote: > On 04/10/18 14:41, Berneburg, Cris J. - US wrote: >> Hi Folks >> >> Anyone have advice on, experience with, or info about setting >> cachingAllowed=false? >> >> BACKGROUND: >> >> Our customer is suddenly getting a JasperException in production. >> To solve, we're planning to upgrade Tomcat to 8.5.x. In our >> testing of TC 8.5.32 on Java 8u181, report output Excel files >> won't load (immediately). An error is displayed to the user. >> These Stack Overflow topics below point to a cachingAllowed >> setting: >> >> - >> https://stackoverflow.com/questions/44852505/tomcat-8-5-takes-too-lon g-to-recognize-new-content >> >> >> - - https://stackoverflow.com/questions/3743136/how-to-disable-tomcat-cach ing >> >> I added to the in >> TC/conf/context.xml, which solved the problem. >> >> QUESTIONS: >> >> 1. What are the ramifications of disabling the cache? IOW, what >> are the potential side-effects? > > The cache keeps the contents of static files in memory to improve > performance. In theory - the more of your requests that can be > served from memory, the faster the response time. The side effect > is a slower response time. How much actual difference this feature > makes will depend on how much static content there is in your app, > how frequently it is requested and how frequently it is changed. > >> 2. Is there a "better" way to specify the setting? > > Maybe. The change you made applied that setting to ALL web > applications in that Tomcat instance. If you only wanted to apply > it to "/foo" then you would create: > $CATALINA_BASE/conf//foo.xml and add > content something like: /> > >> 3. Is there a "better" way to solve the problem? > > For a given value of "better"... > > What is happening is that: - "something 1" requests the file - the > file is not found and the cache records this - "something 2" > creates the file - "something 3" requests the newly created file - > the cache is still valid so the not found' response is returned - > time passes, 'not found' cache response expires - "something 4" > requests the newly created file which is now returned > > something 1/2/3/4 - may all be different - some may be the same - > may be Tomcat or application code > > What you'd need to figure out is what is "something 1" and what > triggers it before "something 2". With that information, you should > be able to refactor the app so "something 1" doesn't happen or > happens after "something 2". > >> CAVEATS: >> >> a. This is a low-volume application. Little traffic and few >> users. >> >> b. Seeing as we're addressing production, we would like to >> implement a rapid solution. Don't want to refactor the >> application, which would take more time. >> >> THANKS: for your time and assistance! > > Given the caveats, you solution looks to be the best (assuming > performance is acceptable). Long ago, we added something similar to what you are talking about. Basically, it was a file-upload capability for images. We waffled about whether to just map the /uploaded-images/ URL space directly to the disk and have DefaultServlet serve the bytes or to write our own servlet to do the work. We opted to write our own (very basic) servlet to do the work because of our concerns over caching by DefaultServlet / Resources. If you want complete control, you have to take responsibility for that complete control. Re-reading the documentation for (specifically, ), it seems that: ... might do the trick, and it would only disable caching for that portion of the disk. Perhaps this would be a better solution, because it only disabled caching for a *portion* of the requests you'll be handling. - -chris -----BEGIN PGP SIGNATURE----- Comment: Using GnuPG with Thunderbird - https://www.enigmail.net/ iQIzBAEBCAAdFiEEMmKgYcQvxMe7tcJcHPApP6U8pFgFAlu2SX0ACgkQHPApP6U8 pFiQlxAAvUP050ASoS/ZbFuEH2bY0On7RozGAZIThJUBlxKVFYOcIeKC6Vz9jB0d IUhBhA4CwXI3Pq908LDkmsV4qtvxwEGb0jhjYc31JThyBWy9Ps9RsPhApFHvt1fR Prdm5/y5PQsi1sU8bYvyA3TIgkgeX5Wh+x/XNh502eR6Y7MaIwrp58u4FzPW9BXx 0/ByD5UCnnpYm7Rhc6+aFB3YzgVrWx04DKgJCp+McjsPpUwVuPsXSG1pqe7Yjp7M EHVRDKmhlB/+UHNPJ+XC8mcFCf0giEFh7k1m9m0jMtCx2hzIe2mt5HYTWi92QtRD Qvko3s/dqtSzqUt2JZoFvG2pyabqsnGNWZmsLQfcHMJXgwRCirRz2rManlHX/qAe 0mbwUc/0wJKyV2P7vcgO9X7tBzqgqIuTbsa11+Qo9xos3/Oi3hDlmo5CdbJ3tX/l QboQnR+5nx2FAkSVfdFblR3eUGBUl8GTX055h0m1KtAw9cOCfaIvyK0Vo681Pahr +4a74tfOH+e+oU7x7pYD+2/7O7d9/1dz4NiCUQNYlMvoLTZJY1A9eDFoxSYajG4Y GfkCJD5kJAiE70lZ7J2rRJLQiA+o+OSjGdHmikYqD00IoK0jJv9nMuNOfDe9FRy7 Q2vAm1yzzkMaZcQPRBFs9RDFw4VtL47j8OpWmFeNdNah2dH4rlg= =QTsR -----END PGP SIGNATURE----- --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org For additional commands, e-mail: users-help@tomcat.apache.org