Custom javascript getting cached ?

Status
Not open for further replies.
Hi,
I am trying to extend the Fabrik by adding a custom javascript file. My file name is form_3.js and I have placed this file at components/com_fabrik/js directory. I can see that this file is getting loaded as part of my Fabrik form. But if I make any changes to this javascript, I don't see the updated javascript getting loaded in the browser. I have cleared the browser cache and I can see that the actual request is made to the server which returns the old content. And if I wait for 2 hours or so and then make a request then my updated javascript gets loaded in the browser.

Looks like I have disabled the Joomla caching.

upload_2019-1-10_20-22-47.png
I also tried to refresh the extension cache by doing the following, but even that doesn't work.

upload_2019-1-10_20-27-41.png

If I rename the file as form_3.txt and then make http://abc.com/components/com_fabrik/js/form_3.txt request; then as and when I update the file I do get the updated file.

Could you please help?

-Nikhil
 
During testing you can set Fabrik options
upload_2019-1-10_16-56-10.png
Burst JS will force a random filename on every load.
 
Also, if you use Chrome, you can force it to reload. Open dev tools (ctrl-shift-I), ignore the actual dev tools window (you can undock it and minimize it), then if you right click on the normal "Reload" button in the top left of the browser, you'll see an option to "Empty Cache and Hard Reload".

Obvously this doesn't help other people on a live site, but if it's just you doing development work, it's the easiest way.

If you need to make a change to a live site with other users, then the "Burst JS" way Troester gave you is the way to go. It'll slow page loads down, as every JS file will get reloaded on every page load, but you can typically turn it off after a few hours, once everyone's caches have timed out.

-- hugh
 
Wow..I didn't know about this "Empty Cache and Hard Reload" functionality in chrome. Many thanks for letting me know.
Between the "Burst JS" way worked for me !!

-Nikhil
 
Status
Not open for further replies.
We are in need of some funding.
More details.

Thank you.

Members online

Back
Top