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.

General Questions /

General questions about getting started with SilverStripe that don't fit in any of the categories above.

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

StaticPublisher publishing pages I have in my ignore list


Go to End


2 Posts   1292 Views

Avatar
Ryoken

Community Member, 18 Posts

17 March 2011 at 10:27am

So I've got a site that was going to go live today, but I ran into a fairly major problem.

I'm using StaticPublisher to cache all the pages, and I've set up an ignore list as mentioned in the docs ( I tried both ways, SQL Where condition in the DataObject::get and the $ignored array ).. It's fine when I run buildcache, but if I save the page from the CMS, and it's one of these Ignored pages, it gets published anyway..

Is there any way around this ? I have some pages that need to be updated on a regular basis, but Cannot be cached for them to function properly.

Thanks for any help anyone can provide.

Avatar
Ryoken

Community Member, 18 Posts

18 March 2011 at 5:17am

So I had to hack around a bit.. Hopefully in a future release of SilverStripe, StaticPublisher will be a little better setup.

For now I made a static array in my Page class of the classes I wanted ignored.
In FileSystemPublisher I use the URLSegment to get the page class of each URL set to be published, and then run them against the ignore array before adding them to the $files array.

In the future I would like to see StaticPublisher implemented a little differently.. My suggestion would be once enabling it, have Method in it's class that can be set in _config to list the ignored page classes. Ideally I'd like to see a checkbox in the Behaviour tab that would allow for caching on a page by page basis. This would, in my opinion, make it a far more useful tool, as having to hack in the CMS folder is not ideal.