Jump to:

17452 Posts in 4473 Topics by 1971 members

Archive

SilverStripe Forums » Archive » Silverstripe Static Caching

Our old forums are still available as a read-only archive.

Moderators: martimiz, Sean, biapar, Willr, Ingo, simon_w

Page: 1 2
Go to End
Author Topic: 3057 Views
  • S0crates9
    Avatar
    27 Posts

    Silverstripe Static Caching Link to this post

    I was reading the post on the DNC static cashing code and I followed the documentation, however silverstripe kept on issuing an error stating that I was missing "FilesystemPublisher". Where do I get this and related files? Its not in cms/code/ ...

    Thanks in advance for any direction.

  • Willr
    Avatar
    Forum Moderator
    5462 Posts

    Re: Silverstripe Static Caching Link to this post

    You need to be using the latest trunk version of the code. Static publishing will be part of the new 2.3 release coming soon. You can download the latest development code on dailybuilds - http://dailybuilds.silverstripe.com/core-tarballs/

  • da_g
    Avatar
    Community Member
    3 Posts

    Re: Silverstripe Static Caching Link to this post

    Got the latest trunk which has FileSystemPublisher and SaticPublisher. I have just installed the standard site (wamp\www\sileverstripe) and edited wamp\www\sileverstripe\mysite\_config.php and added:

    Object::add_extension("SiteTree", "FilesystemPublisher('cache/', 'html')");

    How do I create the static copy of my site and into which directory will it go - wamp\www\sileverstripe\mysite\cache???

  • Willr
    Avatar
    Forum Moderator
    5462 Posts

    Re: Silverstripe Static Caching Link to this post

    to build the cache you run a script called dev/buildcache. You can do this via command line and sake or via the webbrowser by visiting http://www.site.com/dev/buildcache and this will output the contents of the rebuild to a folder called 'cache' on your sites top level (same level as cms, sapphire etc).

  • da_g
    Avatar
    Community Member
    3 Posts

    Re: Silverstripe Static Caching Link to this post

    Tried it, but get a UserError (accessing site using http://localhost/silverstripe/dev/buildcache). Please define a method "allPagesToCache()" on your Page class...

    What exactly should be in my wamp\www\sileverstripe\.htaccess? And do I need to and anything to wamp\www\sileverstripe\mysite\code\Page.php?

  • Willr
    Avatar
    Forum Moderator
    5462 Posts

    Re: Silverstripe Static Caching Link to this post

    Because this is an unreleased feature we currently do not have full docs on it. You need to make the changes to your .htaccess file listed on http://doc.silverstripe.com/doku.php?id=staticpublisher also not listed there, but needed as you can see from your error msgs you need to define the 'cache' on your Page.php file and a few methods for it. Here is a bad example but it should describe the methods to recache every page

  • da_g
    Avatar
    Community Member
    3 Posts

    Re: Silverstripe Static Caching Link to this post

    Thanks. I read / followed the directions in this link but there isn't a mention of what to put in the Page.php file. What should I put in this file? It is for this feature, staticpublish, that I chose this CMS. I really need to get it working.

  • Willr
    Avatar
    Forum Moderator
    5462 Posts

    Re: Silverstripe Static Caching Link to this post

    It needs to go in your Page class (the controller part is only for the templates really). The static caching is all pretty beta code and we are working on the documentation in the coming weeks for it.

    Sorry my last post was meant to have a pastie link - http://pastie.org/pastes/296003 with the basic good

    3057 Views
Page: 1 2
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.