BUG Unable to update static resource ( infinite cache at lightning community side, not browser side)

Seems the new SFDC update ( Spring 17 ), it is now impossible to update a static resource.

We have a static resource named “res”, containing a zip file with following content :

/resource ( folder )

  • /style/myCss.css

  • /img/myImage.jpg

etc ….

When we update myCss.css , regenerate the zip file, upload it by editing the static resource, in our lightning community app we still have the previous content of myCss.css ( checked with Chrome inspector )

We tried lots of things :

  • browser cache delete, change browser, change computer ….

  • even DELETE myCss.css and reuplaod the static resource,clear cache, and lightning app still contains myCss.css !!!

but the result is always the same.

Once a static resource is loaded the first time in a lightning app inside a community, its initial version is cached and can NOT be updated.

Answer

How are you referencing the static resource? I’m betting by direct URL to something in /resource/.

Use $Resource, which adds cache busting tokens to the URL.

Attribution
Source : Link , Question Author : Nicolas Vuillamy , Answer Author : Alderete

Leave a Comment