Need a special offer?Find out if your project fits.
+

Clear Mondrian cache

Answered
MC asked on January 30, 2020

Hi Flexmonster Team,
I have flexmonster accelerator running on Wildfly (as described here). Accelerator cache is disabled.
I want to integrate a button in my WebApp so that one user can clear the Mondrian cache. I have read the documentation on how to clear the cache and I have tried with the following javascript code

var url = "./flexmonster/ClearCache/";
var xmlHttp = new XMLHttpRequest();
xmlHttp.open( "GET", url, false );
xmlHttp.send( null );
return xmlHttp.responseText;

But I'm getting the following error message: 
ERROR. Operation is not allowed. Request was performed from the remote host.
 
Thx for your help.

1 answer

Public
Mykhailo Halaida Mykhailo Halaida Flexmonster January 31, 2020

Hello,
 
Thank you for posting your question.
 
Please note that by default the ClearCache only works when triggered on the host machine. In other words, all requests to the ClearCache outside of the localhost will be refused.
 
In case you want every user to have the right to clear the cache, we would suggest setting up a proxy between the user and your server which would redirect the user's request to trigger the ClearCache on the server with the data.
 
Please let us know if this helps.
 
Best regards,
Mykhailo

Please login or Register to Submit Answer