ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

Help me understand template caching

November 16, 2010 4:18pm

Subscribe [2]
  • #1 / Nov 16, 2010 4:18pm

    The scenario, I am using 2 templates. Let’s call the first template an archives template where I’m displaying 15 latest entries on the page, paginated at the bottom. Let’s call the second template a details template where I’m displaying the full articles, linked from the first archives template. If nothing on those templates changes except for new entries displayed on the archives, and the details template displaying the articles (entry content) linked from the archives template, can I simply cache both template the longest possible time allowed? What is that time in minutes? I’m talking about the Template Preferences under each Template Group.

    In addition, I have enabled “Clear all caches when new entries are posted?” and “Cache Dynamic Section Queries?” under Global Weblog Preferences.

    Martin

  • #2 / Nov 16, 2010 7:59pm

    Rob Allen

    3118 posts

    If a template/page only changes once a day when you add a new post then you could set the cache minutes to anything you wanted because adding a new entry would simply regenerate them anyway.

    For pages/templates that don’t change that often I normally set the caching time to 1440 minutes (24 hours) so each template gets rebuilt just once a day. Of course if I add a new post then that forces all templates to be rebuilt ahead of the daily “schedule”.

    If you have templates that don’t update very often, such as ones that contain “static” content, then you could use longer caching times of a week/month etc, but when you make a new post they’ll be rebuilt anyway.

  • #3 / Nov 16, 2010 8:39pm

    Rob,

    Thanks for chiming in. What if I disable “Clear all caches when new entries are posted?”, the cached templates should still show the new weblog entries, right? What I’m wondering is if the templates caching is only specific to the HTML code changes in the templates, or both html and the weblog:entries tags. Should I only enable “Clear all caches when new entries are posted” when doing weblog caching in the weblog:entries tags, and not template caching? I think that makes more sense.

    Martin

  • #4 / Nov 17, 2010 3:25pm

    Ingmar

    29245 posts

    What if I disable “Clear all caches when new entries are posted?”, the cached templates should still show the new weblog entries, right?

    Eventually, yes. Depending on your other settings they might take a while to appear, though.

    What I’m wondering is if the templates caching is only specific to the HTML code changes in the templates, or both html and the weblog:entries tags.

    The whole template. That said, you’ll probably need to experiment a little to find the optimal results for your server and setup.

.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases