silverstripe-blog
silverstripe-blog copied to clipboard
Suspicion: poor performance loading blog posts on frontend
I've set up a vanilla CWP 2.x-dev site with blog, comments, comment notifications etc (the silverstripe/recipe-blog dependencies), added a blog with two blog posts and three comments on one of the posts, a couple of images inline in the content as well as featured images.
Loading the homepage for me takes around 500ms.
Loading the blog takes around 1.4s.
I haven't looked into this at all, but I suspect a little bit of profiling might surface some areas that could be tweaked to reduce this load time a little.
Here's my debugbar profile of a simple blog with two posts in it:
Can confirm this is an issue. Also affects the rss feed generation hugely.
In my use case the slowness seemed to be due to DBHTMLText parsing shortcodes. I could speed the page up considerably by disabling this within BlogPost::Excerpt
like so
$content->setOptions(['shortcodes' => false]);
However, for any posts with shortcodes like embedded videos, it would make the auto summary look bad.