I have a plugin that responds to two properties values.
If I change either of the properties, the next time the plugin is executed, it appears to use the old value of the property, even though the cache should be cleared when the plugin is saved.
If I manually clear the cache in the Manager before the plugin executes, it responds correctly to the new values.
So first, why doesn’t saving the plugin clear the cache for its properties.
Second, is there anything I can do in the plugin to get fresh properties and avoid the issue?
I could be wrong but it seems that when you change a plugin property and click the “Save” button, it generates 2 XHR-requests.
First one with the action element/plugin/update (that saves the plugin and clears the cache) and then another with the action element/propertyset/updatefromelement (that actually sets the properties-field).
So it seems the cache is cleared before the properties value is set.
Thanks. I never would have thought to look for them there. It’s odd that plugins are not cached in the scripts cache.
It’s also odd that the context cache is not cleared when saving plugins. It explains a lot of odd behavior I’ve seen with plugins over the years. I suspect that that cache is also not cleared when a plugin extra is removed in Package Manager.
It looks like they are cached there as well. But only the code (without the properties).
I believe the context cache is cleared, but the files are then immediately regenerated.
In this specific case, the files are regenerated before the properties value is set.
I agree with Bob. This is a bug. The properties should be updated before the context cache is regenerated, which is always done whenever it is refreshed.