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.

logged_in and caching

April 21, 2008 5:42pm

Subscribe [2]
  • #1 / Apr 21, 2008 5:42pm

    jensa

    109 posts

    Hi all,
    I’m trying to understand how adding member services will affect the performance of my site.  What I’m specifically concerned about is how that classic “Login or Register” / “Welcome back mr X” link on top of all pages in my site will affect performance. Won’t that ruin every possibility of caching the pages?

    I’ve searched a bit about and on this page in the docs it says “The logged in state of the user whose visit prompts the cache to be written will permanently affect the information displayed to all visitors.”

    Does that mean that such a link would prevent caching - thus kill my server? I’ve also read some posts that indicate the opposite but I’ve not found a good explanation anywhere on how this really works.

    J

  • #2 / Apr 21, 2008 5:48pm

    Ingmar

    29245 posts

    What I’m specifically concerned about is how that classic “Login or Register” / “Welcome back mr X” link on top of all pages in my site will affect performance. Won’t that ruin every possibility of caching the pages?

    No. EE caches on multiple leves, there is tag caching as well as SQL caching, eg. Both won’t be affected by an additional query to determine the logged-in user.

    I’ve searched a bit about and on this page in the docs it says “The logged in state of the user whose visit prompts the cache to be written will permanently affect the information displayed to all visitors.”

    That is only true for using {if logged_in} / {if logged_out} inside a Weblog Entries tag on a cached template. While you can use that tag inside {exp:weblog:entries}, this is not necessary to provide a “Login / Welcome Back” link. Also, template caching is only one of the caching mechanisms.

  • #3 / Apr 21, 2008 6:07pm

    jensa

    109 posts

    I’ve not touched any cache settings for my sites yet. From that doc, it looks like I should turn on Template caching (if it’s not already turned on by default?).

    Anyway - I assume this means that every EE page is dynamic, but only the required queries will be executed upon each render. The total “punishment” for adding that link (login/welcome) should then be just a single SQL query?

    J

  • #4 / Apr 21, 2008 6:23pm

    Ingmar

    29245 posts

    I’ve not touched any cache settings for my sites yet. From that doc, it looks like I should turn on Template caching (if it’s not already turned on by default?).

    It depends. There are situations where it’s not desirable, such as when you work with expiring entries, eg. Likewise, if your host has excellent db caching, turning on the SQL cache might actually slow things down, so… it depends.

    Anyway - I assume this means that every EE page is dynamic, but only the required queries will be executed upon each render.

    Every page is dynamic, but EE tries very hard to keep the number of SQL requests to a minimum.

    The total “punishment” for adding that link (login/welcome) should then be just a single SQL query?

    I can’t promise it down to this level of precision, but, as a rule, it does not impact your performance negatively. Just give it a try.

  • #5 / Apr 21, 2008 7:02pm

    jensa

    109 posts

    Thanks Ingmar!
    I’ll do some testing before I launch, but this sounds encouraging.

    I’m on EngineHosting, so from what I’ve read, I shouldn’t turn on the DB caching. I don’t have expiring entries, but I do use future entries to some extent.


    J

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

ExpressionEngine News!

#eecms, #events, #releases