We finished a large SilverStripe-fueled website for a client just before the summer set in and although the client is happy with the website itself, as time has progressed they have become more vocal about the one major complaint they have: the website is often extremely slow with page loads.
Before getting into it in more detail, the address of the website is: http://www.lpb.nl/
This way, those reading this can give it a try themselves. Not every page request is slow loading, but [especially the first load with an empty browser-cache / CTRL+F5] every few pages the problem raises its ugly head once again ;-)
After enabling the NET tab in Firebug and clicking / refreshing until encountering a slow-loading page, it became apparent that the bottleneck seems to be the first GET request of the page, which is the page itself [GET www.lpb.nl]. This request sometimes takes about 4 seconds [whereas normally it should clock in at under a second] but I've also seen it last for over 10 seconds! After the request is finished, all remaining GET requests complete almost instantly.
Prior to starting this thread I've been digging through the archives of the boards using the Search function and have found numerous threads devoted to more or less the same problem [slow-loading websites] but I'm not sure if my case is identical as I've tried a number of the suggested solutions, to no avail.
Here is a list of some things I have tried:
- Installing "SilverStripe Dawn" on the host server to monitor the website; unfortunately, we haven't succeeded in this due to not being able to run the install script as root in an SSH shell and our host won't do this for us either as it's a shared server [we're still awaiting a response from the SS Helpdesk on any alternative methods for installation]
- Enabling the "silverstripe-cache" directory which is now functioning properly
- Making sure the "assets" directory is CHMODed 777
- Adding some lines to the .htaccess file, such as the ExpiresActive/ExpiresDefault lines, "Header unset ETag" and "Header unset Last-Modified"
We have also tried some of the debugging URL variables listed on this page, but haven't been able to draw any conclusions from them. Unless the peak memory usage being 27,5 million bytes is too extreme? [I have no clue ;-)]
None of these efforts have helped improve the speed of the website. We have other [simpler] SilverStripe websites running on the same host which don't share this problem, so the host can't be the cause of it. This LPB website is notably larger though, as it has the following modules installed: DataObjectManager, EventCalendar, GoogleSitemaps, SWFUpload, UserForms and ReCaptcha. We have also developed a few modules of our own, one extending the Members class and a few modules which use DataObjects to store records like user-generated news articles and discussions, and comments made to those.
One thing we have been wondering: it is possible that the initial GET request is sometimes slowed down so much due to our Page.php being filled with "too many" functions? The file itself is 20 KB, which isn't insanely large. But due to it being our first big SilverStripe project and some hard deadlines, whenever we couldn't get functions from child / sibling classes to work in a different class, we moved them into Page.php so we could call them through use of "parent::functionName()". Is it worth it to try and move all of these functions into their rightful classes and see if that speeds up the load-time of the website? Or won't this make any difference?
Any help would be greatly appreciated! We plan to start using SilverStripe as our "CMS for large websites" of choice from now on, so it would be nice to know how we can avoid this problem in the future.