Per plugin caching

63 views
Skip to first unread message

kux

unread,
Oct 26, 2012, 8:32:32 AM10/26/12
to django-cms...@googlegroups.com
Hi guys,

I've been doing some profiling on a django-cms build website, and noticed that long response times are caused by plugin rendering logic.

Would it be a good idea to be able to have some plugin caching functionality?
Ex:

CMS_CACHE_DURATIONS = {
    'permissions': 3600,
    'content': 60,
    'menus': 3600,
    'TextPlugin': 60,
    'LinkPlugin': 60
}

This would also mean that CMSPluginBase would also need to have a method for invalidating the cache. The developers writing their own plugins could call this cache invalidating method in post_save hooks.

If you don't find this as being a good idea, what would you guys do for improving the front end view's response time?

Regards,
Alex

Jonas Obrist

unread,
Oct 27, 2012, 12:07:40 PM10/27/12
to django-cms...@googlegroups.com
Hi Alex,

Do you have any details what exactly is slow in plugin rendering? What versions (CMS/Django) are you using?

Before we prematurely just slap caching on top of something, let's try to figure out why it's slow and if there's not better ways to solve this.

Jonas

kux

unread,
Nov 1, 2012, 6:22:00 AM11/1/12
to django-cms...@googlegroups.com
Hi Jonas,

There's nothing inherently slow within the cms itself.
The problem is when you have pages with dozens of plugins the rendering simply takes time.

Most of the times, the problem is within the plugin itself. For example cmsplugin-feed  uses the feedparser library that needs around 2s to parse a medium sized rss feed.
You can obviously try to improve the performance of each plugin by optimizing parsing algorithms and so on, but that would obviously take a lot of time and it might require forking third-partly libraries.

The easiest way would be to implement caching for each plugin, but then you'd have to write very similar logic in all plugins, so I thought it would be a nice feature for django-cms to offer this feature.

Regards,
Alex
Reply all
Reply to author
Forward
0 new messages