1. Fabrik 3.9 has been released. If you have updated Joomla to 3.9, this is a required update.
    Dismiss Notice

Custom javascript getting cached ?

Discussion in 'Community' started by nikhil.pa@gmail.com, Jan 10, 2019.

Thread Status:
Not open for further replies.
  1. nikhil.pa@gmail.com

    nikhil.pa@gmail.com Member

    Level: Community
    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
     
  2. troester

    troester Well-Known Member Staff Member

    Level: Community
    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.
     
  3. cheesegrits

    cheesegrits Support Gopher Staff Member

    Level: Community
    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
     
  4. nikhil.pa@gmail.com

    nikhil.pa@gmail.com Member

    Level: Community
    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
     
Thread Status:
Not open for further replies.

Share This Page