Commerce Server Cache Refresh

I was teaching a Commerce Server Training this past week. One of the students asked that he has issues with his business users management applications. When the business users select to refresh the site cache an error is generated. I did some research and found that there is a KB article about how to fix such issues. The KB article can be found here.

When I first read the KB article I thought that there must be an error, because it asks to setup the orders web service. So during my class I tried to replicate his issue and sure enough I was able to do it. I looked at my Virtual PC systems and everything worked.

How come this worked on my Virtual PC systems? Well I had my systems setup with the administrator account as the application pool identity. In the orders web service and the front end servers by default the administrator account is configured in the authorization node of the web.config.

How does the Cache Refresh Work?

When the users selects to refresh the cache the call is made to the orders web service SiteCacheRefresh.axd (tested with Commerce Server Service Pack 2) then to the front end web server farm. I never really looked at the error message, if you pay attention you will notice that the error message clearly state that a calls was made to the orders web service's SiteCacheRefresh.axd and access was denied.

How to Fix Cache Refresh?

In a production environment each web service has it's own application pool and they in turn have their own identity, if you followed the 120 page setup documentation :). You need to write down the Marketing, Catalog and profile web service's application pool identity account and add it to the orders web service web.config.

<location path="SiteCacheRefresh.axd">
    <system.web>
        <authorization>
            <allow roles="BUILTIN\Administrators"/>
            <allow users="Domain\CatalogAppPoolIdentity"/>
<allow users="Domain\MarketingAppPoolIdentity"/>
<allow users="Domain\ProfileAppPoolIdentity"/>
            <deny users="*"/>
        </authorization>
    </system.web>
</location>

Next you will need to add the orders web service account to the front end web server farms as noted in the KB article.

 

Additional resource you should read "Understanding Caching in Commerce Server".