sometimes I need to clear my users browser cache if I for example add a new button to the CKEditor or change some CSS.
Is there a way to force the users browser to clear their cache via an Option or script in XWiki?
I tried
(I come from a DokuWiki background where I could force my user’s browsers to refresh their cache for the wiki, when I did a change in the config.php file).
How do you currently change the CSS? One possible option is to use an XWiki StyleSheetExtension either at the wiki level or at a page level, or on demand. XWiki will then automatically add the version of that StyleSheet to its URL when including it, hence forcing the browser to load the ressource. If not enough, you can add an option yourself when including the StyleSheet extension, by adding some parameters to the call.
Regarding the CKEditor customization, it might be different, I’ll look that up separately, let us know how it goes with StyleSheet extensions already maybe?
Regarding CKEditor, as far as I can see, the custom CKEditor configuration is loaded from application-ckeditor/webjar/[…]/config.js. An XWiki JavaScript extension forcing the reload of the CKEditor.Config parameters might be a path toward clearing the cache, not sure. Hoping this helps,
Currently I am using both StyleSheetExtensions for some things and in the admin menu under the “advanced” tab in the menu where you can edit your wiki-theme I have some CSS code.
Thanks to your tip, I’ve put the CSS I had in the “advanced” tab into its own StyleSheetExtension and it got immidiatly applied, so thanks for that.
But there is a still a problem I think, you can test this yourself by changing some values in the Admin-Menu:
In the Admin-Menu > Look & Feel > Themes > Color Theme > Customize
Change for example for Panels the background color
After you’ve done that and go back to your wiki, the change wont take effect
You have to manually refresh your browser-cache to make the changes appear.
Also there is still the remaining issue with the CKEditor which isn’t as big a problem because if the Editor wont load the users will come to me and I can tell them to refresh.