Custom WMS map caching issue

Hi guys. I’m doing a project in which I built a custom geoserver to provide map layers through WMS protocol and integrate with Mission Planner using Custom WMS.
However, as I noticed, there was a caching issue when I tried to change the layers to be displayed from WMS. When I load the new layer from WMS, Mission Planner GUI still display the old layer. Not until I zoom in on the map, the new layer started to kick in, but parts of the old layer still overlapped the new ones.
I also noticed that there were no caching settings in the Mission Planner GUI. I disabled the caching of the geoserver layers before rendering to Mission Planner as well, hence I dont think the server is the culprit.
How can I mitigate this issue?

you can force rendering of the layers by touching the position property of the mapcontrol. I used something like this in my Plugins
Host.FDGMapControl.Position = Host.FDGMapControl.Position;

Note: also add this to the onZoomChange event handler to force redraw on zoom change.

Which files is this event handler in? And do I need to change anything else in the code? I simply cloned and rebuilt the code from github without adding any plugins

Look in the properties of the map control you using.

I tried adding the code to map control as you said, but it did not mitigate the issue. MP still rendering old layers when I zoom out.

Updated: I think the reason is that the layers’ cached data keep overlapping each other. I deleted the cache data in C://ProgramData//MissionPlanner//gmapcache and it worked cleanly. But still, this obviously not a graceful way to do so.