tobiak777
tobiak777

Reputation: 3365

Site Map and other site metadata updates won't show up due to caching issue

Due to the fact that I am using the OWIN authentication, I had to put the cms on a different website. The cms is at cms.domain.com and in my VS project for domain.com I simply pointed the "piranha" connection string to the right database. So far everything was working perfectly, I only had to change the MediaProvider do deal with the domain name issues for the 2 retrieve methods of IMediaProvider.

Now I'm trying to integrate the menu using the @UI.Menu helper, however it looks like the helpers are not using the database of the Web.Config file (I have no problem to retrieve posts from C#). I only see the Start page listed. To confirm it I have also tried to change the site description from cms.domain.com/manager and to display it with the helper @Site.Description but it still shows default site description so it really looks like there is another database around..

Where does data used by the HTML helpers come from? And How can I fix that?

UPDATE : It seems that it is actually a caching issue, it has nothing to do with the connection string.

Upvotes: 0

Views: 185

Answers (2)

Håkan Edling
Håkan Edling

Reputation: 2753

Piranha CMS caches a lot of meta-data for performance and to minimize the round-trips to the database. The site information, as well as the sitemap is two of these things as these will most likely be used in every page-rendering.

The default cache implementation uses the IIS cache, which is per application pool. The cache is invalidated when data is modified in the manager interface, but if you for example would run the manager interface in another application pool (site/application) this will make the caching fail, causing the kind of errors you describe.

Not being sure how your application is set up, this is my primary guess. If you are in fact running the client web & the manager in different application pools, and you need to continue doing this you should try one of the following approaches.

  1. Implement a distributed cache provider
  2. Set the system param CACHE_SERVER_EXPIRES to 1

Setting the param to 1 invalidates all server cache after one minute. This is of course not to recommend if you are expecting a lot of traffic to your site as it will more or less disable the caching mechanism.

I hope this helps you.

Best regards

Håkan

Upvotes: 1

tobiak777
tobiak777

Reputation: 3365

All of sudden it's now working. The only thing I remember to have done is delete duplicate entries in the dbo.page table. It's all working now, however it doesn't explain why the Site Description wasn't retrieve properly too. But never mind, I hope this will help someone else. I hope custom authentication will be built-in in the next release of Pirhana CMS !

Upvotes: 0

Related Questions