2 Replies Latest reply on Mar 23, 2012 10:05 AM by lholmquist

    Cache practices

    lholmquist

      Are there any plans to show the best practices for caching js/css files in any of the quickstarts. 

       

      I'm using apache as my front end with mod_jk to as 7.1.  Is there a document out there that already shows how to set the access time for js/css files?

        • 1. Re: Cache practices
          kborchers

          Lucas,

           

          Thanks for the question! I would like to answer it in two parts.

           

          First, the kitchensink quickstart https://github.com/aerogear/as-quickstarts/tree/master/kitchensink-html5-mobile is already using a form of caching of most of the JS and CSS files. By using CDN hosted versions of jQuery and jQuery Mobile, the largest chunks of JS and CSS are most likely already cached on the users machine if they have visited any other site that uses those CDNs which is highly likely. If they haven't, it will load from the CDN and then be cached on their machine so any subsequent visit will load much faster.

           

          As for the other JS and CSS files, you could implement something like mod_expires on Apache to allow for caching any of the other files in the app (JS, CSS, images, etc.).

           

          We do intend to write examples or at a minimum articles, on caching best practices but nothing like that exists at this time. If you would like, please feel free to create an issue regarding caching examples and best practices in our project JIRA or if you prefer, I can create it for you.

           

          Thanks!

          • 2. Re: Cache practices
            lholmquist

            thanks for the quick reply. 

             

            I'll create a JIRA then.

             

            just a quick question about the mod_expires,  does it matter that the js/css files are being served by jboss in my war and not in the htdocs directory of apache?

             

            using html5boilerplate.com's examples i added some expiration stuff to my httpd.conf,  but it didn't seem to work.  could be configuration on my end though.

             

            -Luke