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

November 15, 2010 6:49pm

Subscribe [4]
  • #1 / Nov 15, 2010 6:49pm

    municipal

    165 posts

    Is it possible (or advisable) to set the Refresh Interval to something like 99999? The data will be very static and there is no need to serve the data from the database (unless an entry is added/deleted/changed). When the cache expires and the new, initial page load occurs, it’s just taking too long to retrieve 210 database entries.

  • #2 / Nov 16, 2010 8:50am

    Sue Crocker

    26054 posts

    Give it a try and see what happens. But let’s talk about those 210 database entries. Are you displaying just the titles, or the titles and parts of the entries? Are you using any disable settings?

  • #3 / Nov 16, 2010 3:53pm

    municipal

    165 posts

    I’m displaying the title plus 6 custom fields. It’s really not a lot of stuff. This is driving me crazy. I did all the “usual” stuff to optimize things.

    Have disable=“categories|member_data|pagination|trackbacks”

    Queries are around 26.

  • #4 / Nov 17, 2010 3:17am

    John Henry Donovan

    12339 posts

    municipal,

    Have you tried to Cache Dynamic Weblog Queries?
    CP Home ›  Admin ›  Weblog Administration ›  Global Weblog Preferences

    Switch on your Display Template Debugging?
    What is the page load time? What is taing the longest to load?
    CP Home ›  Admin ›  System Preferences ›  Output and Debugging Preferences

    Are any of those 6 fields third party custom fields?

  • #5 / Nov 17, 2010 7:02am

    municipal

    165 posts

    Gulp…I am using the Multi-Text extension for one of the custom fields. With template debugging turned on, I see that this beauty—Calling Extension Class/Method: Multi_text/modify_template—gets called 207 times.

    For my initial test, I added custom_fields to the weblog’s disable parameter to gauge to what extent all the other fields were slowing things down. Surprisingly, this did not prevent the field using the multi-text extension from being output so that was pointless.

    Next up, looking at caching dynamic weblog queries…

    Test results…inbetween each of the following tests, I cleared all caches via the CP.
    ——————————————————————————————————————————————-
    Test #1:
    A—Cache Dynamic Weblog Queries OFF
    initial page load—> Elapsed Time: 3.8729   Queries: 28
    subsequent page load—> Elapsed Time: 0.8356   Queries: 18

    B—Cache Dynamic Weblog Queries ON
    initial page load—> Elapsed Time: 3.6855   Queries: 28
    subsequent page load—> Elapsed Time: 0.8071   Queries: 18
    ======================
    Test #2:
    A—Cache Dynamic Weblog Queries OFF
    initial page load—> Elapsed Time: 4.2547   Queries: 28
    subsequent page load—> Elapsed Time: 0.7890   Queries: 19

    B—Cache Dynamic Weblog Queries ON
    initial page load—> Elapsed Time: 4.9322   Queries: 28
    subsequent page load—> Elapsed Time: 0.9360   Queries: 18
    ======================
    Test #3:
    A—Cache Dynamic Weblog Queries OFF
    initial page load—> Elapsed Time: 5.0373   Queries: 28
    subsequent page load—> Elapsed Time: 0.9148   Queries: 18

    B—Cache Dynamic Weblog Queries ON
    initial page load—> Elapsed Time: 3.7055   Queries: 28
    subsequent page load—> Elapsed Time: 0.7989   Queries: 18
    ======================
    Test #4:
    A—Cache Dynamic Weblog Queries OFF
    initial page load—> Elapsed Time: 3.7178   Queries: 29
    subsequent page load—> Elapsed Time: 0.8771   Queries: 18

    B—Cache Dynamic Weblog Queries ON
    —initial page load—> Elapsed Time: 3.7184   Queries: 29
    —subsequent page load—> Elapsed Time: 0.8865   Queries: 18
    ——————————————————————————————————————————————-
    Conclusion: Caching dynamic weblog queries doesn’t do a whole lot and isn’t gonna make or break things.

    So, considering the almost static nature of this content, is there a better way to do this? For example, write the output to a file on the server and retrieve it from there? I realize that’s precisely what caching the template accomplishes but it’s still slow and honestly (and I should have said this early on), the elapsed time is not really reflecting how long it takes to fully load in my browser…it really takes a lot longer!

    Or maybe I’m back to my original question (I guess) of whether using a refresh interval of 99999 is the best way to go in this case? Does “99999” actually do what I think it should?

    Edited to add:
    P.S.—I see that the site_short_name is wrong but I don’t see any place to change it in the CP. (Looking at the database backup, it appears early on in the exp_sites table.) How do I correct this? Manually through phpMyAdmin?

  • #6 / Nov 17, 2010 4:49pm

    Ingmar

    29245 posts

    So, considering the almost static nature of this content, is there a better way to do this?

    A sub-template, perhaps? Or snippets?

    Or maybe I’m back to my original question (I guess) of whether using a refresh interval of 99999 is the best way to go in this case? Does “99999” actually do what I think it should?

    No, that’s an absurd value. Your cache is going to be refreshed eventually.

    I see that the site_short_name is wrong but I don’t see any place to change it in the CP.

    Have you tried Sites > Edit Sites? You certainly mustn’t edit exp_sites directly; you’ll damage the serialized array.

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

ExpressionEngine News!

#eecms, #events, #releases