Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

We've moved the forum!

Please use forum.silverstripe.org for any new questions (announcement).
The forum archive will stick around, but will be read only.

You can also use our Slack channel or StackOverflow to ask for help.
Check out our community overview for more options to contribute.

Customising the CMS /

Moderators: martimiz, Sean, Ed, biapar, Willr, Ingo, swaiba

Staticpublisher - No static files for forms


Go to End


4 Posts   2120 Views

Avatar
cliersch

Community Member, 75 Posts

13 March 2009 at 6:21am

Edited: 13/03/2009 6:21am

Hi!
I'm using the staticpublisher on my SS v2.3. It's working perfectly.
But I need to load some sites dynamicly - the User Defined Forms e.g.
Ho may I define for which sites or site types should not be used the .html files?
Should I use a special form inside every class?

Avatar
bschmitt

Community Member, 22 Posts

18 March 2009 at 11:49pm

Hi there!

I've quite the same problem. As mentioned here http://doc.silverstripe.com/doku.php?id=staticpublisher Staticpublisher is designed to generate cache files from static content. So far good so good, but you have also the possibility to sync these cache files to another server via rsync. This works well if you don't have a form (e.g. search) or in general an user action or dynamic content on your page.

Is there a way to cache both, static and dynamic pages (partly) and publish via rsync? I think this is the 95% case!

Many thanks and best regards,
Bjoern

Avatar
Sam

Administrator, 690 Posts

9 April 2009 at 3:15pm

Edited: 09/04/2009 3:17pm

Hi Björn,

You can't do partial caching, but what you *can* do is rsync the entire web-root - cache files, PHP files, assets and all. This works well as long as you pick 1 box to be the "CMS server" that the rsyncs are executed from.

We usually do this by setting up cms.sitename.com to point to one of the boxes in the cluster, and www.sitename.com to load-balance between all boxes.

As for how you define which pages to cache, and which to not cache, that is controlled by your pagesAffectedByChanges() and allPagesToCache() methods.

Potentially, you could add a checkbox field, CacheThisPage, to your Page class, and then use that to define the output of allPagesToCache()

Thanks,
Sam

Avatar
linkoovi

Community Member, 12 Posts

18 October 2010 at 1:45am

Edited: 18/10/2010 1:46am

Hey,

@cliersch Can you help, Im having a problem seting up staticpublisher on SS 2.3.2, the doc is for 2.4 and i even changed the FilesystemPublisher and StaticPublisher classes with ones from SS 2.4, but no luck.

My SS has a Subsites Modul