Alternative to StaticPublisher

72 views
Skip to first unread message

Damian Mooyman

unread,
Mar 21, 2013, 9:31:11 PM3/21/13
to silverst...@googlegroups.com
A little while ago I had a project requiring me to optimise a site for heavy traffic, so was directed to look at the StaticPublishing mechanism.

However, there were some things I really did not like about this, namely the requirement that the cache had to then be rebuilt in order to view the site. I also had some issues with enumerating the SiteTree, since (at least in my application) a page could have different views applied to it (using various urls to redisplay localised content).

I developed a new module which did caching in a different way, caching content on the fly, a single page at a time using output buffering https://github.com/tractorcow/silverstripe-dynamiccache. Splitting up the task of caching content meant that updating content in the back end no longer had a massive overhead, and doing caching on a request by request basis meant that different page views (such as different page actions on a single page) gave me a more robust cache. Pages that don't ever get viewed aren't cached.

It's very beta and finicky at the moment; There are a few hacks in there for bypassing cache for form errors and so on, but if anyone can give me feedback on this I'd be grateful.

I was really happy to get page loading times down from 2 seconds to 40ms. :)

fuz...@gmail.com

unread,
Mar 22, 2013, 5:01:57 AM3/22/13
to silverst...@googlegroups.com
Clever idea !  Thanks for putting this online.

Gave it a little try on 2 of my sites, and it seems to work wonderfully.

Damian Mooyman

unread,
Mar 27, 2013, 9:53:07 PM3/27/13
to silverst...@googlegroups.com
Please let me know of any issues you come across. All feedback is useful!

Please note that currently CSRF is disabled... it's an important consideration if you are running any security critical application.

David Brunelle

unread,
Apr 23, 2013, 1:09:16 PM4/23/13
to silverst...@googlegroups.com
Hi Damian,

You mentioned this module is rather finicky and very beta... any specifics we should watch out for? I'm inclined to give this module a try over StaticPublisher for an upcoming project but "very beta" is a bit concerning. I'm more of a front-end guy, but if there are any specific issues you're aware of I can see if any of our PHP devs have the availability to contribute.

I'd also love to see additional work be done in this area. This seems like a much more logical approach to caching than StaticPublisher's approach. It would be great to see this functionality become part of core (replacing StaticPublisher). Either that, or consider removing StaticPublisher from core and making it available as a module.

Thanks!

David


-- 
David Brunelle | Capitol Media, Inc.
--------------------------


--
You received this message because you are subscribed to the Google Groups "SilverStripe Core Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email to silverstripe-d...@googlegroups.com.
To post to this group, send email to silverst...@googlegroups.com.
Visit this group at http://groups.google.com/group/silverstripe-dev?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Will Rossiter

unread,
Apr 24, 2013, 8:10:12 PM4/24/13
to silverst...@googlegroups.com
Static publisher has already been removed from core in 3.1 and published to a module https://github.com/silverstripe-labs/silverstripe-staticpublisher

Cheers

Damian Mooyman

unread,
Apr 24, 2013, 8:29:51 PM4/24/13
to silverst...@googlegroups.com
Hi David, it's a lot more robust now. It's being used currently on a live website, and has gone some fixes and tweaking since I initially posted this.

As with the static publisher, you just need to take care where pages are displaying dynamic content, especially in forms.

I did notice that there were some issues hosting on IIS that didn't show up on apache, but it should be fixed.

Give it a try and let me know of any problems you face.

Kind regards,

Damian

Damian Mooyman

unread,
Apr 24, 2013, 8:30:50 PM4/24/13
to silverst...@googlegroups.com
I think as little as possible should be included in the core; Things such as these are better suited to external modules, especially where there are so many different flavours of solutions for each problem.

Will Rossiter

unread,
Apr 24, 2013, 8:44:35 PM4/24/13
to silverst...@googlegroups.com
I think as little as possible should be included in the core; Things such as these are better suited to external modules, especially where there are so many different flavours of solutions for each problem.

Exactly the philosophy 3.0 has taken (e.g with comments, widgets, reports, staticpublisher modules). I believe there was another thread on what else could (should?) be stripped out of 'core' but that's another discussion (File is my next target :D)
Reply all
Reply to author
Forward
0 new messages