Search code examples
ibm-mobilefirstmobilefirst-adaptersmobilefirst-server

Is there a way to clear IBM MobileFirst Platform server Cache?


I'm working on an IBM MobileFirst Platform 7.1 project where there are many name value pairs in the worklight.properties file.

Say for example,

HOST_NAME = www.google.com

I access these variables form the MobileFirst adapter.

var hostName = WL.Server.configuration["HOST_NAME"]

There will be cases where I'll have to change the HOST_NAME in the worklight.properties to a different value. But sometimes, even after the value is changed in the worklight.properties file, they are not getting updated in the adapter.

Every time when I change the values I do the following,

  1. Clean the project
  2. Restart the server
  3. Deploy the adapter again

Nothing seemed to change the value.

I suspect, the MobileFirst server caches the values and reuses the old values without updating the new ones. I say this because, I tried deleting the values in the worklight.properties file, and even tried deleting the file itself. Still the adapter was using the old value.

I tried deleting the MobileFirstServerConfig Folder in my workspace. Even that didn't work.

It would be great if someone could help me clear the cache or find a work around to this issue. Thanks in advance.


Solution

  • I kind of followed the above method but initially it didn't work.
    But later I tried to follow these steps in this exact order and it seemed to work.

    1. Stop Worklight Server.
    2. Remove your project from Mobile First Development Server.
    3. Go to the "bin" directory and remove your project war.
    4. Clean and Build the entire workspace.
    5. Start the server
    6. Deploy the adapters
    7. Run your app.