Cache usage approach

7 visningar
Hoppa till det första olästa meddelandet

Alexander Obuhovich

oläst,
29 jan. 2011 15:19:392011-01-29
till In-Portal Development
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 then 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 sence, when page is selected to be fully cache (in "Structure & Data" in admin console).




--
Best Regards,

http://www.in-portal.com
http://www.alex-time.com

Dmitry A.

oläst,
29 jan. 2011 18:15:012011-01-29
till in-por...@googlegroups.com
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

Alexander Obuhovich

oläst,
29 jan. 2011 18:17:492011-01-29
till in-por...@googlegroups.com
Prototype: yes

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

Dmitry A.

oläst,
29 jan. 2011 20:49:202011-01-29
till in-por...@googlegroups.com
Ok, makes sense now.

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


DA

Alexander Obuhovich

oläst,
19 juli 2012 16:36:102012-07-19
till in-por...@googlegroups.com
Ping to Dmitry.

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

Dmitry A.

oläst,
22 juli 2012 01:23:242012-07-22
till in-por...@googlegroups.com
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?



DA

Alexander Obuhovich

oläst,
22 juli 2012 08:43:362012-07-22
till in-por...@googlegroups.com
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.

Dmitry A.

oläst,
23 juli 2012 00:34:512012-07-23
till in-por...@googlegroups.com
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

Alexander Obuhovich

oläst,
23 juli 2012 07:17:242012-07-23
till in-por...@googlegroups.com
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.
Svara alla
Svara författaren
Vidarebefordra
0 nya meddelanden