How To Refresh The Umbraco Cache

A client I started working for had a lot of gripes with their Umbraco 6 website. Whenever one of the content team tried to create new pages and upload images onto the site, a lot of strange 404s errors would always occur until the site was reset in IIS.

After some investigation, the cause of the issue was that the partner who had setup Umbraco for them wasn’t familiar with configuring Umbraco to work in a load balanced environment. The partner had configured it as a normal .NET website. Instead of making the required changes in ‘umbracoSettings.config; and the ‘web.config’ they simply copied the web root onto two servers and left the site to run. This resulted in a lot of Umbraco cache issues and a few database conflicts when content editors had been working on the site at the same time.

If you are reading this wanting to setup Umbraco in a load balanced format, then I suggest you read this tutorial, How To Configure Umbraco To Work In A Load Balanced Environment.

The lack of correct configuration on the live site made a lot of strange things occur in the backend. One of these issues was the ‘Oops: this document is published but is not in the cache (internal error)’ which was visible against the document link in the ‘Properties’ tab.

Umbraco_Opps

There are several ways you can try to fix this issue, in a web browser add this to the end of your websites URL:

/Umbraco/dialogs/republish.aspx?xml=true

so the full URL might look like:

http://www.website.com/Umbraco/dialogs/republish.aspx?xml=true

Umbraco_Opp1

From this screen, all you need to do is press the ‘Republish Entire Site button. This will clear the cache and regenerate it. It everything went successfully, you should see this nice and friendly success screen.

Umbraco_Opp2

The other way to access this feature is via the content editor. If you right click on your top level node:

Umbraco_Opp3

This process is exactly the same as the one above. The benefit of creating a shortcut is that you can set a shortcut up for each node in your load balanced environment and you can quickly and easily update your cache on all node in the event of something bad occurring.

Clear the Umbraco Examine Logs

If you have issues with the cache you may also want to clear your search result. Umbraco uses a module called ‘UmbracoExamine’. Under the hood, UmbracoExamine wraps the Lucene search index APi to Umbraco to index and search data easily within the website. Lucene will index your website and store the results on disk. This indexing and disk storage greatly improves your search capabilities.

In Umbraco sites the Lucene indexes for your website can be found in the ‘App_Data’ -> ‘Temp’ -> ‘ExamineIndexes’. To delete the indexes is as simple as deleting the files from disk. After you delete the files, you will need to restart your website in IIS. If you don’t you might get this error:

Umbraco_Opp4

As soon as you restart the environment, your publishing should start working again.

Jon D Jones

Software Architect, Programmer and Technologist Jon Jones is founder and CEO of London-based tech firm Digital Prompt. He has been working in the field for nearly a decade, specializing in new technologies and technical solution research in the web business. A passionate blogger by heart , speaker & consultant from England.. always on the hunt for the next challenge

More Posts

0 replies

Leave a Reply

Want to join the discussion?
Feel free to contribute!

Leave a Reply

Your email address will not be published. Required fields are marked *