0
Welcome Guest! Login
0 items Join Now

Caching explained...?

    • Andy Miller's Avatar
    • Andy Miller
    • Preeminent Rocketeer
    • Posts: 9919
    • Thanks: 96
    • Web Kahuna

    Re: Caching explained...?

    Posted 14 years 1 month ago
    • Ok, this is actually a really good question, and i'll do my level best to answer it.

      Caching and Compression

      Joomla

      * Global Config - GZip Compression : This setting tells the webserver (typically Apache) to use gzip compression when sending the main HTML output that Joomla generates. This can reduce the size of the file quite dramatically. On the order of 70-90%. The main benefit of this is that the time it takes to send the file to the browser is greatly reduced, however the trade off is the webserver has to do more work in order to compress the file. Usually the tradeoff is worth it and we recommend enabling GZip compression on all sites.

      * Global Config - Cache Settings : This setting is the global toggle to enable caching for Joomla. Every extension looks to this setting to see if they should cache their output. During development this can cause some strange lingering effects as updating an article will automatically flush the com_content cache, but it's not smart enough to know that a module might of had part of this same article cached. In these cases after you edit an article you should also manually flush the cache via the "clean cache" setting in Tools. Cache is the primary method to increase performance, so we highly recommend enabling this and setting it to 30-45 minutes when you are running in a 'live' environment. It's less handy during development, so we generally don't enable cache until we're ready for business.

      * Plugin Manager - System-Cache : When you have enabled the Global config cache setting, you have the option to enable the System-Cache plugin. This cache plugin performs a 'page-cache' which can potentially have a huge performance boost, however due to it's nature, it's very rarely a viable option. What this plugin does is take the rendered Joomla output and store it in it's entirety in the cache. The next user to visit the page, get's shown the exact same output as the user before. This limits the amount of per-user customization that can be done, and you could potentially show data to a user that should not see it. In Gantry we send specific CSS files to IE users and don't send those files to other browsers. This is a performance optimization to ensure that only the files you need are sent, however a page cache breaks this as it will send you the same files no matter what your browser. Also if you have any 'dynamic' data displayed, that will be cached, and not updated. Overall, unless you have a very static site, this is not useful, and with Gantry it's not practical at all. We recommend not using this cache option.


      Gantry

      * Template Details - Gantry Cache : Gantry is a very powerful and highly flexible framework. As such there are lots of configuration options and information regarding features, overrides, etc. In order to help with performance the Gantry Cache stores some of this data in a format that negates the need to re-parse the configuration details on every load. It also stores data about currently published modules and other Joomla related data. The cache is flushed every time you 'save' or 'apply' in the template details so it's pretty safe to enable this setting at all times. If you ever make a change to a file, and find it's not being reflected in the template, you can just re-save the template parameters and it will flush the cache, and show your reflected change. This setting can increase performance dramatically, however we generally don't enable it ourselves during the early phases of development, but when we are getting closer to a final template release, we enable it and certainly have it enabled on any live site.

      * Template Details - Gantry GZipper : The Joomla Global Config "GZip" option is helpful, but it only compresses the main HTML output that Joomla generates. The Gantry GZipper feature is really a lite version of the RokGZipper plugin. The Gantry GZipper option extends on this by helping out with CSS and JavaScript files controlled by Gantry. Basically it combines any files it can into the minimal amount of files possible to reduce HTTP requests, and then it toggles the headers in order for the webserver to send these files in a GZip compresses format. Because we split out our CSS into multiple files in order to ensure we only send the data a user needs, we end up with quite a few CSS files, so combining and gzipping them is a helpful technique. Use this setting only when going live as any changes you make to those files will not be picked up immediately as the browser is being sent 'combined and cached' versions. Also sometimes the in-browser caching and optimization can out-weight the benefits of this setting. So use Firebug or Safari/Chrome web-inspector to see if your performance is improved by enabling this setting. It almost always is helpful, and sometimes dramatically, but we've seen instances where it doesn't help also. Moral is, to try it yourself for your particular setup. NOTE: SHOULD NOT BE USED IN CONJUNCTION WITH ROKGZIPPER. SEE BELOW.

      * Plugin Manager - RokGantry Cache : This was an experimental plugin that has traditionally only been included in the RocketLauncher packages. Basically this plugin is a helper for the Gantry Cache setting. It flushes the cache when you make any changes in Joomla that could potentially impact the Gantry cache. For example if you published a module, then it would flush the cache as Gantry needs to know how many modules are published in a particular position. We are now going to start including this module in the Gantry "bundle" download as it has proved quite useful. We recommend enabling this if it's available.


      Extensions

      * Plugin Manager - System-RokGZipper : RokGZipper is basically a more powerful version of the Gantry GZipper option, so please read the description of Gantry GZipper above to get a feel for what RokGZipper does and why. Where Gantry GZipper only handles it's own Gantry-based CSS and JS files, RokGzipper will attempt to combine and compress all CSS and JS it finds on a page. This means it can help with all 3rd party extension CSS and JS as well as the files generated by the template. Again as with Gantry GZipper, you should enable this towards 'go-live' time and ensure that performance is in fact improved. We recommend using RokGZipper instead of Gantry GZipper if both are available as RokGZipper is more powerful and works across the whole page. However, Gantry GZipper is often better than nothing if you don't have RokGZipper installed. Our recommendation is to enable this for 'live' sites and disable the Gantry GZipper option.
    • Adamck's Avatar
    • Adamck
    • Elite Rocketeer
    • Posts: 546
    • Thanks: 2
    • Web Developer, IT Assistant, Graphics design, App Developer

    Re: Caching explained...?

    Posted 14 years 1 month ago
    • Cool :) can this be stickied?
      It would seem that this is something everyone could do with understanding! 8)
    • Kiss my RSS
    • Max Power's Avatar
    • Max Power
    • Sr. Rocketeer
    • Posts: 239
    • Thanks: 5
    • June Mtn

    Re: Caching explained...?

    Posted 14 years 1 month ago
  • Re: Caching explained...?

    Posted 14 years 1 month ago
    • Great question and thanks Andy for explaining how it all works correct.
  • Re: Caching explained...?

    Posted 14 years 4 weeks ago
    • Thanx! :D
    • Robert D. Wagers's Avatar
    • Robert D. Wagers
    • Elite Rocketeer
    • Posts: 1545
    • Thanks: 0
    • Full-Time Cancer Fighter!

    Re: Caching explained...?

    Posted 14 years 2 weeks ago
    • Awesome!
      Very informative Andy!
      The different options/combinations can be "mind boggling" at times!

      Wage
    • "Everyone has to get knocked-down every once-in-a-while, otherwise you'll never learn how to get-back-up! "
      A quote attributed to my Grandpa Wagers
  • Re: Caching explained...?

    Posted 14 years 2 weeks ago
    • I remeber someone here said that certain cache plugin has to be at the end of plugin list or some bugz will ocure... Was it System-cache?
      Anyway, which order should cache and zip plugins be?
  • Re: Caching explained...?

    Posted 13 years 11 months ago
    • Incredible info!
      And what about Cache Handler (APC, File), on Joomla - Global Config - Cache Settings?


      FZ
    • El Guillatún - Revista digital de arte y cultura
      www.elguillatun.cl
    • Andy Miller's Avatar
    • Andy Miller
    • Preeminent Rocketeer
    • Posts: 9919
    • Thanks: 96
    • Web Kahuna

    Re: Caching explained...?

    Posted 13 years 11 months ago
    • a PHP opcode cache such as APC or what we prefer, XCache, can only help further. I strong advice using one of these two.
  • Re: Caching explained...?

    Posted 13 years 11 months ago

Time to create page: 0.087 seconds