Force CKEDITOR to refresh config

前端 未结 10 2271
鱼传尺愫
鱼传尺愫 2020-12-13 06:36

I created a cms application that use CKEDITOR and when I add some functionality to CKEDITOR I need to refresh some CKEDITOR .js /.css file.

But CKEDITOR force the

相关标签:
10条回答
  • 2020-12-13 06:57

    I found a much simpler method, in case anyone is still frustrated by this.

    If you open the config file URL with the timestamp appended (eg. ?t=XYZD) in your browser, hard-refresh it, then return to your application page and refresh that, you should get the new version of the config file.

    You need to use the same timestamp as is set by ckeditor in the source of the page. If you use developer tools or Firebug, typing CKEDITOR.timestamp into the console will give you the value to use.

    0 讨论(0)
  • 2020-12-13 06:58

    This trick works in Firefox for not just CKEditor but for any page on which you want to toggle local caching.

    1. Open Firefox debugging console (F12).
    2. Open console settings (F1).
    3. Enable "Disable HTTP Cache (when toolbox is open)".
    4. Keep console open :)

    After a very brief check, I could not find a similar setting in Chrome nor IE.

    HTH

    0 讨论(0)
  • 2020-12-13 06:59

    You could always add a unique timestamp as a variable in your url, or just do a hard refresh (CTRL + F5)

    0 讨论(0)
  • 2020-12-13 07:02

    Method wich works is put CKEDITOR with improved config and css files to the new subcatalog:

    src="/ckeditor_new_one/ckeditor.js"

    0 讨论(0)
  • 2020-12-13 07:05

    I have found a quite elegant way:

    It is enough to set:

    CKEDITOR.timestamp='ABCD';
    

    just after you link ckeditor.js or anyhow before ckeditor loads all its files

    this is the variable CKEDITOR uses to add timestamp to all .js .css files it loads dynamically.

    So every time I change those files I update that variable and browsers will reload them.

    0 讨论(0)
  • 2020-12-13 07:06

    On Firefox:

    1. Go to about:config
    2. Set network.http.use-cache to false
    0 讨论(0)
提交回复
热议问题