admin管理员组

文章数量:1333694

I'm developing a TinyMCE plugin, however the changes I'm making to the plugin do not get loaded into TinyMCE after the first time it's loaded (It's getting cached). This is happening on both FF and Chrome.

If I search the cache in Firefox, I find a reference to the plugin's editor_plugin.js file with a cache expiry of 6 days 23 hours.

The only way I can get round this is to clear the cache on the browser every time I want to test a change - Anyone else get this behaviour? Am I missing something obvious here?

I'm developing a TinyMCE plugin, however the changes I'm making to the plugin do not get loaded into TinyMCE after the first time it's loaded (It's getting cached). This is happening on both FF and Chrome.

If I search the cache in Firefox, I find a reference to the plugin's editor_plugin.js file with a cache expiry of 6 days 23 hours.

The only way I can get round this is to clear the cache on the browser every time I want to test a change - Anyone else get this behaviour? Am I missing something obvious here?

Share Improve this question asked Oct 24, 2012 at 13:17 Tr1stanTr1stan 2,7751 gold badge27 silver badges45 bronze badges 1
  • When I say the only way I can get round it is to clear the cache, this isn't actually true, I could obviously change the name space it gets loaded into each time, but that just seems ridiculous... – Tr1stan Commented Oct 24, 2012 at 13:19
Add a ment  | 

3 Answers 3

Reset to default 5

To force reloading the cache on clients, tinyMce implements the solution with a cache_suffix. It will reload all the files if you change the suffix.

tinymce.init({
  selector: 'textarea',  // change this value according to your HTML
  cache_suffix: '?v=4.1.6'
});

https://www.tiny.cloud/docs/configure/integration-and-setup/#cache_suffix

There is an easy way in Firefox to get rid of the chache on every new page load. You need to install Firebug. Go to the network tab and choose "deactivate browser cache".

Usually I manipulate the changed script's referring url, for example:

ed.windowManager.open({
    file : url + '/image.htm?v1',...});

The file name is not changed, but the script vill be reloaded at production time too.

本文标签: javascriptForce TinyMCE to reload pluginStack Overflow