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.

Themes /

Discuss SilverStripe Themes.

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

Flushing Entire Site Cache


Go to End


5 Posts   27807 Views

Avatar
Sean1100

Community Member, 2 Posts

4 June 2009 at 10:02am

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!

Avatar
Howard

Community Member, 215 Posts

4 June 2009 at 11:13am

Avatar
Sean1100

Community Member, 2 Posts

6 June 2009 at 7:36am

Edited: 06/06/2009 7:37am

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. :)

Avatar
Tama

Community Member, 138 Posts

9 August 2010 at 1:57pm

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

Avatar
Mateusz U

Community Member, 2 Posts

10 August 2010 at 5:04pm

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