Lets assume that you have two umbraco instances

  • A delivery site – publicly accessible site with no access to the CMS admin screens
  • An authoring site – Usually an IP restricted site which has access to the CMS admin panel

Both of these sites will share the same data base and media library.

You have cached content within the application, anything from a list in a HTTP cache to media content and now the data has been updated in the CMS. You can see the content on the authoring site, but you cant see the content on the delivery site until the cache has expired.

There are two publishing events that you can use when updating content to refresh the caches on both instances

  • PageCacheRefresher.CacheUpdated
  • MediaCacheRefresher.CacheUpdated

 

Create a new ApplicationEventHandler in the site and add both of these methods in and expire your caches as required.

When the content is updated in the CMS on your authoring site, it will update the database and call events. This will then call your custom code to clear and rebuild your cache which will enable the delivery site to be updated when content is entered in authoring.

The documentation still needs updating here https://github.com/umbraco/UmbracoDocs/issues/324 

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s