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.

Template Caching & Keeping cache when entries get updated

September 08, 2010 3:02pm

Subscribe [3]
  • #1 / Sep 08, 2010 3:02pm

    Noah Kuhn

    60 posts

    I have a fairly complex site setup using Fieldframe and Matrix fields for 36 different “items” in a weblog. Each item is loaded with the same template.

    When I load any of the item pages with no caching, it’s taking 1.5 seconds and 175 queries to load. This is mostly due to dynamically pulling in information about each item from related weblogs. Way too many queries. I haven’t been successful getting the time down without caching.

    When I turn on template caching, the page loads are .25 seconds with around 40 queries. Still a high query count I think, but the page load is nearly instantaneous.

    So this is working… well.

    Problem is that whenever I update one of the items (new description, typo, etc.), ALL 36 page caches get refreshed, not just the single item page cache. Is there a way to ONLY refresh the relevant item page cache? It makes no sense to flush the caches when nothing has changed on 35 of the pages.

  • #2 / Sep 08, 2010 10:01pm

    Brandon Jones

    5500 posts

    Hi Noah,

    In this case template caching is working as expected. Have you experimented with query caching?

  • #3 / Sep 14, 2010 1:03pm

    Noah Kuhn

    60 posts

    Yes, I have, I’m using both, if I just use query caching it makes no difference.

    After clearing the cache, Is there a way to somehow automatically walk the directory structure to hit each page and “cache” everything again so you don’t have to visit every page to get it into the cache?

    The issue seems to be FieldFrame and Cartthrob settings. They are getting pulled for each entry and I end up with tons of crap which is slowing the page load down…

    (0.175528) Calling Extension Class/Method: Cartthrob_ext/weblog_entries_tagdata
    (0.183836) Calling Extension Class/Method: Fieldframe/weblog_entries_tagdata

    ...same calls over and over for each entry…

    (1.723152) Calling Extension Class/Method: Fieldframe/weblog_entries_tagdata
    (1.741381) Calling Extension Class/Method: Cartthrob_ext/weblog_entries_tagdata

    I know this probably lies with the Extension writers, but any ideas?

    Noah

  • #4 / Sep 14, 2010 2:24pm

    Noah Kuhn

    60 posts

    Perhaps not very elegant, but I tried a wget on the site. I suppose I could put that in a cron job that runs every day to refresh the site.

    wget -r --follow-tags=a,link,script,img --exclude-directories=cart,login -erobots=off URL


    or with no images / stylesheets, just

    wget -r --follow-tags=a --exclude-directories=cart,login --reject=png,jpg -erobots=off URL


    or just spider mode (don’t download files)

    wget -r --follow-tags=a --exclude-directories=cart,login --reject=png,jpg -erobots=off --spider URL
  • #5 / Sep 15, 2010 2:44am

    John Henry Donovan

    12339 posts

    Noah Kuhn,

    After clearing the cache, Is there a way to somehow automatically walk the directory structure to hit each page and “cache” everything again so you don’t have to visit every page to get it into the cache?

    Not out of the box no. I can move this thread to the CodeShare Corner if you wish to share any ideas with other members?

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

ExpressionEngine News!

#eecms, #events, #releases