How can I clear the Umbraco Cache? Options
AlexRamsey
Posted: Friday, February 29, 2008 4:04:16 AM
Rank: Newbie

Joined: 2/19/2008
Posts: 7
Hi,

I have 2 umbraco sites connected to a single db. When updates are made on one they don't appear on the other.

Is there a standard way of clearing the cache on the site that is displaying the older content?

I cannot use the load balancing feature in the umbracoConfig.xml because one of the sites cannot be pinged as it sits on an intranet.

I've tried using "HttpRuntime.UnloadAppDomain()" and "umbraco.library.RePublishNodesDotNet(-1)" within a usercontrol, but that does not work either.

Has anyone experienced this issue before?

Thanks in advance,
Alex.
AlexRamsey
Posted: Friday, February 29, 2008 4:09:09 AM
Rank: Newbie

Joined: 2/19/2008
Posts: 7
Sorry my mistake,

Quote:
I cannot use the load balancing feature in the umbracoConfig.xml because one of the sites cannot be pinged as it sits on an intranet.


I meant to say the "umbracoSettings.xml" not the "umbracoConfig.xml" file.

Alex.
drobar
Posted: Friday, February 29, 2008 4:59:57 AM

Rank: Umbracoholic

Joined: 9/8/2006
Posts: 1,698
Location: KY, USA
Hi, Alex,

I'm afraid what you're trying to do is impossible. You not only need to share the database, but also the filesystem. Also, they servers must be able to communicate to one another via TCP/IP to keep each other informed of changes.

You can read more about it here:
http://forum.umbraco.org/18691

cheers,
doug.

MVP 2007-2009 - Official Umbraco Trainer for North America - Percipient Studios
AlexRamsey
Posted: Friday, February 29, 2008 5:16:52 AM
Rank: Newbie

Joined: 2/19/2008
Posts: 7
Hi Douglas,

Thanks for the reply.

I am currently replicating the filesystem via an ftp service which is scheduled to run at a certain time to keep any media files synchronised with the latest changes. This works ok.

What I need is some way of programmatically clearing the content cache and pulling in the new content when the site with the older content is started.

I've managed to setup an actionhandler on the publish event, that updates a db table. That table is then read when the site with the older content is started. However none of the standard ways of clearing the cache using a Usercontrol seem to work.

I've also tried the ASP.NET Cache Manager (see: http://forum.umbraco.org/reply?post=21222), but this has no effect either.

Any ideas?

Thanks,
Alex.
AlexRamsey
Posted: Friday, February 29, 2008 5:26:23 AM
Rank: Newbie

Joined: 2/19/2008
Posts: 7
Hi,

If I manually recyle the appDomain by touching the web.config file this clears the cache and updates the site with the latest content. The programmatic way to do this is by using "HttpRuntime.UnloadAppDomain()" but I'm not sure how to get this to work in a user control within umbraco.

Any ideas appreciated.

Thanks,
Alex.
AlexRamsey
Posted: Wednesday, March 05, 2008 10:07:51 AM
Rank: Newbie

Joined: 2/19/2008
Posts: 7
Ok, managed to find a solution to this problem.

Adding the following to a user control will work:

umbraco.library.PublishSingleNode(Id);
HttpRuntime.UnloadAppDomain();

With the Id being the value of the node being published on the other website.
Users browsing this topic
Guest


You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.