0

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">
        <script>konfigurator/konfigurator.js</script>
        <lifetime>null</lifetime>
    </action>
</reference>

But it does not work? Is it even possible?

2 Answers 2

1
<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>
</reference>
3
  • How does this work in my case?
    – Black
    Oct 12, 2018 at 20:36
  • What do you exactly want to do , disable a js cache via layout ? if yes why ?
    – PЯINCƎ
    Oct 12, 2018 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, 2018 at 12:58
-2

I think it's use full to you

<block class="Block\Class" name="blockname" cacheable="false" />
2
  • But I have no block, I just want to add a JavaScript file.
    – Black
    Oct 12, 2018 at 12:13
  • This is a M2 code
    – PЯINCƎ
    Oct 12, 2018 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.