🍉 Meet Flexmonster Pivot Table & Charts 2.9.Check out all hot features!
Get Free Trial

Clear Mondrian cache

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

Mykhailo Halaida Mykhailo Halaida Flexmonster January 31, 2020

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,

Please login or Register to Submit Answer