Uploaded image for project: 'MyFaces Core'
  1. MyFaces Core
  2. MYFACES-2864

Allow caching of resources by the default external context impl

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 2.0.2-SNAPSHOT
    • 2.0.2
    • General
    • None

    Description

      We've seen in our testing significant improvements in performance by caching the results of getResource() and getResourcePaths() calls. Adding this caching has led to about a 30% increase in throughput on an older JSP application, and a doubling of throughput on JSF2/facelets applications that utilize templating and composite components. This testing was all done on WAS so gains could be different on other servers depending on the behavior of their servlet containers.

      In the patch I'm attaching, it currently sets that the default for the caching is enabled if the project stage is production and I've defaulted the cache size to 500 entries. I've created two context params that allow for overriding the size and/or disabling the cache outright.

      There might be a few cases where this will need to be disabled. Most prominently would be anyone who adds or removes files to a production environment. This could cause problems for an application that generates dynamic content on disk instead of in memory, although I don't know if that is common enough that we'd want to turn it off by default given the gains that the majority of users would see.

      Please review the patch and let me know if there should be any tweaks or if anyone feels strongly one way or the other about whether it should be enabled or disabled by default. I'll plan on committing Monday based on any consensus.

      Attachments

        1. MYFACES-2864-patch.txt
          8 kB
          Michael Concini
        2. MYFACES-2864-patch2.txt
          20 kB
          Michael Concini
        3. MYFACES-2864-patch2-fixed.txt
          21 kB
          Michael Concini

        Issue Links

          Activity

            People

              mconcini Michael Concini
              mconcini Michael Concini
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: