Completely rebuild all caches?

Stefan Hall shared this question 2 months ago
Answered

Hi,

We want to “move” the data source in an existing YF system to a different environment, from Dev to QA. Basically done quickly, another jdbc connection and “done”.

But: how do I force YF to rebuild its many caches? I mean the cached filter values, the report data that should not always be queried live, etc.

Is there a rebuild function for all caches? Can I reset/empty this data at DB level in the repository?
I hope you can help me.

;) Stefan - v9.14

Replies (5)

photo
1

Hi Stefan,

I hope you're doing well.

It's possible to refresh/delete the entries in the various caches via the web services. You can use either the REST or SOAP API to accomplish a cache refresh.

Taking the filter cache as an example, you can do this in either of two ways:

For the REST API, use the endpoint /api/caches/FILTER with the authorisation headers YELLOWFIN, nonce, timestamp and access token.

For the SOAP API, an example .jsp is below, but it requires you to specify the particular filter ID:

<%      
/*          ws_flushcachedfilter.jsp                */
%>
<%@ page language="java" contentType="text/html; charset=UTF-8" %>
<%@ page import="com.hof.util.*, java.util.*, java.text.*" %>
<%@ page import="com.hof.web.form.*" %>
<%@ page import="com.hof.mi.web.service.*" %>
  
    AdministrationServiceResponse rs = null;
    AdministrationServiceRequest rsr = new AdministrationServiceRequest();
    AdministrationServiceService ts = new AdministrationServiceServiceLocator("localhost", 8080, "/services/AdministrationService", false);
    AdministrationServiceSoapBindingStub rssbs = (AdministrationServiceSoapBindingStub) ts.getAdministrationService();
 
    rsr.setLoginId("admin@yellowfin.com.au");
    rsr.setPassword("test");
    rsr.setOrgId(new Integer(1));
    rsr.setFunction("FLUSHCACHEDFILTERCACHE");
     
    //Specify filter ID to flush its cache
    rsr.setParameters(new String[] {
            "12323"
    });
     
    rs = rssbs.remoteAdministrationCall(rsr);
 
    if ("SUCCESS".equals(rs.getStatusCode())) {
        out.write("Success </br>");
    } else {
        out.write(rs.getStatusCode());
        out.write(rs.toString());
    }


As the SOAP request seems to be more specific, you're probably better off using a combination of REST API calls to refresh all the available caches. The end point options available are:

GEO_PACK
VIEW_GEOMETRY
VIEW
REPORT
DASHBOARD_TAB
PERSON
TEXT_ENTITY
CATEGORY
DOCUMENT
FILTER

You can read more about cache management services for the REST API at this link and for the SOAP API on our Wiki page here.

I hope that helps. Let me know if you have any other questions.

Kind regards,

Chris

photo
1

Hi Stefan,

I hope you're doing well. Just checking in to see if you have any more questions on this topic or need any additional assistance.

Let me know.

Kind regards,

Chris

photo
1

Hi Chris,

Thank you for your information, that helps me.

I had hoped for an option via the AdminUI, but I probably don't need it that often after all. I'll put together a few calls and send them to the system

Have a nice weekend
;) Stefan

photo
1

Hi Stefan,

I hope you had a good weekend.

No worries. I'll keep this open for a couple more days in case you have any questions from your results.

Kind regards,

Chris

photo
1

Hi Stefan,

Just to let you know I'm closing this one off for now but we can always revisit it later if you have any more questions.

Kind regards,

Chris

Leave a Comment
 
Attach a file