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

Static Publisher


Go to End


3 Posts   1658 Views

Avatar
cumquat

Community Member, 201 Posts

12 August 2013 at 10:55pm

Hi there i'm trying to speed up some of my 3.1 sites and i'm looking at using the static publisher, i have followed the instructions on the docs but they mention adding some code to the .htaccess file, there is a link but that goes to a restricted access page. Do i need to add to the .htaccess for static publisher to work. below is my current set up.

### SILVERSTRIPE START ###
<Files *.ss>
	Order deny,allow
	Deny from all
	Allow from 127.0.0.1
</Files>

<Files web.config>
	Order deny,allow
	Deny from all
</Files>

# This denies access to all yml files, since developers might include sensitive
# information in them. See the docs for work-arounds to serve some yaml files
<Files *.yml>
	Order allow,deny
	Deny from all
</Files>

ErrorDocument 404 /assets/error-404.html
ErrorDocument 500 /assets/error-500.html

<IfModule mod_alias.c>
	RedirectMatch 403 /silverstripe-cache(/|$)
	RedirectMatch 403 /vendor(/|$)
	RedirectMatch 403 /composer\.(json|lock)
</IfModule>

<IfModule mod_rewrite.c>
	SetEnv HTTP_MOD_REWRITE On
	RewriteEngine On
	RewriteBase '/'

	RewriteCond %{REQUEST_URI} ^(.*)$
	RewriteCond %{REQUEST_FILENAME} !-f
	RewriteCond %{REQUEST_URI} !\.php$
	RewriteRule .* framework/main.php?url=%1&%{QUERY_STRING} [L]
</IfModule>
### SILVERSTRIPE END ###

regards

Mick

Avatar
martimiz

Forum Moderator, 1391 Posts

13 August 2013 at 5:33am

Edited: 13/08/2013 5:33am

I never noticed Static Publisher being moved to its own module, but obviously, for 3.1, this is the case:

https://github.com/silverstripe-labs/silverstripe-staticpublisher

I guess you'll find the necessary info in the docs section...

Avatar
guci0

Community Member, 2 Posts

2 October 2013 at 12:38am

Edited: 02/10/2013 10:26pm

Uff – works!

But I am wondering about a translatable module.
Is possible to join StaticPublisher&Translatable to working together ?

Best regards!

P.S. I thought that I'm already joined forum, hmm...

EDIT: It's works, but only via Publish button, via allPagesToCache() doesn't.
$pages = SiteTree::get(); returns only Translatable::set_default_locale('lang') (records / pages);

How to fix this?

EDIT 2:

Does the trick, for now:

Translatable::disable_locale_filter(); and Translatable::enable_locale_filter();

EDIT 3:

Another problem is: allPagesToCache() when we have enabled
URLSegmentFilter.default_allow_multibyte, there is no cache file, for example:

Publishing page 2/18: /localhost/%D0%B4%D0%BE%D0%BC%D0%B0/ <- fired, but file of cache is lost, don't write.