Is it possible to disable caching of javascript files in Tridion?

72 views
Skip to first unread message

Andreas Vestlund

unread,
Jan 24, 2012, 5:07:12 AM1/24/12
to Tridion PowerTools
Hi everyone!

I am developing some extension for a client and my client is not happy
having to clear their cache to get the latest version of the deployed
extension. Do anyone of you know if there is a way to not cache the
javascript that is in the Editor extension?

What I have tried:
http://hungred.com/how-to/tutorial-stop-caching-jquery-javascript/ - I
have tried the random url and meta tags in aspx and it doesnt help. My
aspx is successfully not cached though.

http://www.iis.net/ConfigReference/system.webServer/caching?showTreeNavigation=true
- I have tried adding setting output caching to none on the virtual
folder of the Editor extension in IIS. This did not help... I also
tried adding:
<system.webServer>
<caching enabled="false" enableKernelCache="false" />
</system.webServer>

to my web.config (of the extension) without success.

After having tried web.config stuff in the local web.config I also
tried it in the config for the whole Tridion site. Adding a output
caching rule for .aspx with no caching resulted in my Editor extension
not being able to communicate with the Model extension.


Best Regards
Andreas Vestlund

Jeff Wisor

unread,
Jan 24, 2012, 5:57:29 AM1/24/12
to tridion-p...@googlegroups.com
This will make Javascript easier to read:
“%TRIDION_HOME%\web\WebUI\WebRoot\Configuration\System.config”
a. Make JavaScript easier to read
i. Change
1. <filter for="Script" type="Tridion.Web.UI.Resources.Filters.JScriptMinifier, Tridion.Web.UI.Resources.Filters" enabled="always">
ii. To
1. <filter for="Script" type="Tridion.Web.UI.Resources.Filters.JScriptMinifier, Tridion.Web.UI.Resources.Filters" enabled="never">

-----
Reduce browser cache duration of Tridion GUI elements
i. Change
1. <cache httpexpireduration="P10Y0M0DT0H0M0S"/>
ii. To
1. <cache httpexpireduration="P0Y0M0DT0H0M10S"/>
iii. This changes the duration of Tridion items in the browser from years to 10 seconds - you can set it as low as needed.

Thanks,

Jeff

Andreas Vestlund

unread,
Jan 24, 2012, 7:30:16 AM1/24/12
to Tridion PowerTools
Thanks a lot for your input Jeff! Will try this out :)

Best Regards
Andreas
> >http://hungred.com/how-to/tutorial-stop-caching-jquery-javascript/- I
> > have tried the random url and meta tags in aspx and it doesnt help. My
> > aspx is successfully not cached though.
>
> >http://www.iis.net/ConfigReference/system.webServer/caching?showTreeN...

Frank van Puffelen

unread,
Jan 24, 2012, 9:07:36 AM1/24/12
to Tridion PowerTools
In that same System.config file you will also find this element:

<server version="6.1.0.55920" modification="11">

Increasing the modification number will effectively force the GUI to
re-download every file. I find this is sometimes needed when I add a
new file to the project, not as much when I simply make changes to the
files.

Frank

On Jan 24, 7:30 am, Andreas Vestlund <vestlund.andr...@gmail.com>
wrote:

Andreas Vestlund

unread,
Jan 25, 2012, 3:07:05 AM1/25/12
to Tridion PowerTools
Thanks Frank! That looks better than trying to fiddle with disabling
cache programmatically. Increasing that number when deploying is a
good idea :)

Best Regards
Andreas

Andreas Vestlund

unread,
Jan 25, 2012, 3:17:07 AM1/25/12
to Tridion PowerTools
Thanks Frank! That looks better than trying to fiddle with disabling
cache programmatically. Increasing that number when deploying is a
good idea :)

Best Regards
Andreas

On Jan 24, 3:07 pm, Frank van Puffelen <fvanpuffe...@sdl.com> wrote:

Peter Kjaer

unread,
Jan 27, 2012, 10:44:58 AM1/27/12
to Tridion PowerTools
This is exactly the scenario that the @modification attribute is
designed for.
You will want to keep all of the caching as-is and just increase that
number whenever you deploy a new version of an extension.


On Jan 25, 9:17 am, Andreas Vestlund <vestlund.andr...@gmail.com>
Reply all
Reply to author
Forward
0 new messages