I want to disable cache for a specific file which I am loading with a layout file. Is this possible?

I tried it like this, because I saw it like this somewhere:

<reference name="head">
    <action method="addJs">

But it does not work? Is it even possible?

<reference name="block.name">
    <action method="unsetData"><key>cache_lifetime</key></action>
    <action method="unsetData"><key>cache_tags</key></action>
    <action method="setCacheLifetime"><s>0</s></action>
  • How does this work in my case? – Black Oct 12 '18 at 20:36
  • What do you exactly want to do , disable a js cache via layout ? if yes why ? – PЯINCƏ Oct 12 '18 at 20:44
  • yes. Because I am developing a javascript file and I always have to wait 2 minutes before I can see the changes. – Black Oct 13 '18 at 12:58

I think it's use full to you

<block class="Block\Class" name="blockname" cacheable="false" />
  • But I have no block, I just want to add a JavaScript file. – Black Oct 12 '18 at 12:13
  • This is a M2 code – PЯINCƏ Oct 12 '18 at 14:50

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.