Cache usage approach

7 views
Skip to first unread message

Alexander Obuhovich

unread,
Jan 29, 2011, 3:19:39 PM1/29/11
to 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.

unread,
Jan 29, 2011, 6:15:01 PM1/29/11
to 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

unread,
Jan 29, 2011, 6:17:49 PM1/29/11
to in-por...@googlegroups.com
Prototype: yes

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

Dmitry A.

unread,
Jan 29, 2011, 8:49:20 PM1/29/11
to 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

unread,
Jul 19, 2012, 4:36:10 PM7/19/12
to 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.

unread,
Jul 22, 2012, 1:23:24 AM7/22/12
to 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

unread,
Jul 22, 2012, 8:43:36 AM7/22/12
to 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.

unread,
Jul 23, 2012, 12:34:51 AM7/23/12
to 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

unread,
Jul 23, 2012, 7:17:24 AM7/23/12
to 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.
Reply all
Reply to author
Forward
0 new messages