Child pages
  • Cache usage approach
Skip to end of metadata
Go to start of metadata

Imported From: http://groups.google.com/group/in-portal-dev/browse_thread/thread/818b4b3d9c4be91a#

We currently have 2 caching modes:

  • cache page completely (only makes sense for static page - when all visitors see the same content)
  • cache template parts via <inp2:m_Cache ...> cacheable content here </inp2:m_Cache> tag

I've recently talked to Slava and he suggested another caching approach:

  • cache all but specific page parts, e.g. located in <inp2:m_NotCache ...>...</inp2:m_NotCache> tags

This will work this way:

  • cold start (when page not cached):
    • parse all <inp2: tags in requested template, but don't parse tags in <inp2:m_NotCache ...> tags
    • store resulted HTML (with some non-parsed tags in it) in memory
    • read cached page from memory
    • parse tags, skipped during page caching process
    • show page
  • normal start (when we have cache):
    • read cached page from memory
    • parse tags, skipped during page caching process
    • show page

When page mostly consists of static parts, then selecting non-static parts will be more efficient (less tags required), then marking all cacheable parts. Also it's easier to read one large part from cache, rather than a lot of small parts.

For example cache all page, but mark areas, where banners are displayed as non-cacheable.

Of course <inp2:m_NotCache tag will only make sense, when page is selected to be fully cache (in "Structure & Data" in admin console).

8 Comments

  1. Hi Alex,

    This is an interesting idea, I say we should try creating a prototype for
    this approach.

    By the way, does that mean we are getting rid of  <inp2:m_Cache ...> tags?

    DA

  2. Prototype: yes

    Get rid of tag: no, that will 3rd approach of cache usage.

    On Sun, Jan 30, 2011 at 1:15 AM, Dmitry A. <dandre...@gmail.com> wrote:
    > Hi Alex,

    > This is an interesting idea, I say we should try creating a prototype for
    > this approach.

    > By the way, does that mean we are getting rid of  <inp2:m_Cache ...> tags?

    > DA

  3. Ok, makes sense now.

    I guess we'll be waiting for some tests/prototype from your side before
    creating the task?

    DA

  4. Ping to Dmitry.

    Are we doing something OR not doing OR waiting for Varnish to solve that
    problem with ESI:INCLUDE functionality?

    On Sun, Jan 30, 2011 at 3:49 AM, Dmitry A. <dandre...@gmail.com> wrote:
    > Ok, makes sense now.

    > I guess we'll be waiting for some tests/prototype from your side before
    > creating the task?

    > DA

  5. Hi Alex,

    I think we should discuss this in more details on one of our meetings.

    I have read more about Varnish today and this it has potential.

    They are working on v3.1 and v4 already, which brings me to my question
    when (version) you checked on this problem with Includes you are referring
    to?

    https://www.varnish-cache.org/docs/3.0/tutorial/esi.html

    DA

  6. It's not a problem with includes. It's a solution.

    Basically you split pages into a pieces, that have different caching
    intervals and then cache them using esi:include technique. This way Varnish
    manages all that and only requests small templates mentioned in esi:include
    when required. Other parts of pages are served from Varnish cache.

  7. Yes, I understand how it work in general, but I thought you said there is
    some sort of bug/issue with Varnish Includes.

    I am considering Varnish as an option for VO project so we can
    test-case/drive things there on 1 or 2 projects. It can give significant
    boost considering data is not changing too often.

    Is there a way for us to talk to Varnish Cache and reset it directly from
    In-Portal if needed?

    DA

  8. Yes, it has several ways of communication:

       - do a telnet request and issue commands directly to Varnish instance
       - create a special rule that would match magic url (e.g.
       http://www.my-website.tld/purge_vcl_cache) and do a Varnish command and
       not pass this url back to Apache/Nginx.

    On Mon, Jul 23, 2012 at 7:34 AM, Dmitry A. <dandre...@gmail.com> wrote:
    > Yes, I understand how it work in general, but I thought you said there is
    > some sort of bug/issue with Varnish Includes.

    > I am considering Varnish as an option for VO project so we can
    > test-case/drive things there on 1 or 2 projects. It can give significant
    > boost considering data is not changing too often.

    > Is there a way for us to talk to Varnish Cache and reset it directly from
    > In-Portal if needed?

    > DA