Jump to:

1374 Posts in 487 Topics by 520 members

Themes

SilverStripe Forums » Themes » Flushing Entire Site Cache

Discuss SilverStripe Themes.

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

Page: 1
Go to End
Author Topic: 8784 Views
  • Sean1100
    Avatar
    Community Member
    2 Posts

    Flushing Entire Site Cache Link to this post

    How does one flush the entire site cache after a template change?

    http://mysite.com/?flush=1
    and
    http://mysite.com/home?flush=1

    ...aren't doing it. Thanks in advance!

  • Howard
    Avatar
    Community Member
    215 Posts
  • Sean1100
    Avatar
    Community Member
    2 Posts

    Re: Flushing Entire Site Cache Link to this post

    Thank you! I promise I searched far and wide for this answer and got nowhere. This thread is also now atop the results for "silverstripe flush template cache" in Google, so here's to your future fame and riches.

  • Tama
    Avatar
    Community Member
    130 Posts

    Re: Flushing Entire Site Cache Link to this post

    Hi there

    Does this only work when a site is running in "dev" or "test"?

    Running it on our live website returns the following:

    Website Error
    Forbidden

    The website server has not been able to respond to your request.

    Cheers
    Tama

  • Anonymous user
    Avatar
    Community Member
    2 Posts

    Re: Flushing Entire Site Cache Link to this post

    Should work on live. If it doesn't, it means you don't have the ADMIN permission

          if (isset($_GET['flush']) && $_GET['flush'] == 'all') {
             if(Director::isDev() || Director::is_cli() || Permission::check('ADMIN')) {
                self::flush_template_cache();
             } else {
                return Security::permissionFailure(null, 'Please log in as an administrator to flush the template cache.');
             }
          }

    Mateusz

    8784 Views
Page: 1
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.