Developer forum

Forum » CMS - Standard features » Clear cache for DW

Clear cache for DW

Dan Avramescu
Reply

Hello,

I was wondering if there is an easy method to clear the cache in dynamicweb. We have a solution in load balancing and we want to refresh the cache on demand so when we make some changes on one of the servers (like adding a new page, changing info in paragraphs, etc.) they are also updated on the other server. 

The clearcache = 1 and refresh=yes are not working. I was thinking of creating a page that clears the ASP.NET cache:

HttpContext.Current.Cache.Remove

but I would need some specific keys to remove only the cache for pages and paragraphs.

Is this a bad idea?


Replies

 
Nicolai Høeg Pedersen
Reply
This post has been marked as an answer

Hi Dan

Dynamicweb has support for doing this it self - it has a service layer that can invalidate cache across nodes. You need the right license to run with that.

DW has a number of different caches - page cache is renewed calling refresh=yes, paragraphs are not cached at all and Ecommerce is having most of its cache in application state - we do not use httpContext cache that many places. You could simply remove everything from application items.

Votes for this answer: 1
 
Dan Avramescu
Reply

Thanks! I found the Load balancing under Web and Http and it wasn't enabled. Everything seems fine after I checked it.

 
Adrian Ursu
Reply

I just spoted something weird related with this caching.

The NLB is configured correctly (at least apparently). We are using 2 instances: a primary one handling all admin tasks and scheduled tasks and a secondary one for the public.

We have run the indexing on the admin machine and the indexing finished successfully but on the public machine the reported index is the one before the update.

I have recycled both app pools, restared the websites and still no change. The information on the public website (secondary machine) is not updated.

Is there something we miss?

Thanks,

Adrian

 
Nicolai Høeg Pedersen
Reply

Usually when running in a NLB environment you have 2 serveres sharing the same file system. So if one node updates the index, it gets updated on both since they are running on the exact same filesystem.

If you use 2 filesystems, you need to handle sync your self - I know others that does that by using robocopy. Should also be able to to that with DFS

 
Adrian Ursu
Reply

Hi Nicolai,

It's the same filesystem but it does look to have a significant lag until the public version is updated.

Thanks,

Adrian

 

You must be logged in to post in the forum