Skip to content

Commit 7268cab

Browse files
committed
Rename loki.script from container to block to allow caching
1 parent 20d7d8f commit 7268cab

1 file changed

Lines changed: 25 additions & 5 deletions

File tree

view/base/layout/loki_base.xml

Lines changed: 25 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,21 +10,27 @@
1010
</referenceContainer>
1111

1212
<referenceContainer name="before.body.end">
13-
<container name="loki.script">
14-
<block name="loki.alpinejs" template="Loki_Base::script/alpine-csp.phtml"/>
15-
16-
<block name="loki.script.variables" template="Loki_Base::script/variables.phtml">
13+
<container name="loki.dynamic-script">
14+
<block name="loki.dynamic-script.variables" template="Loki_Base::script/variables.phtml">
1715
<arguments>
1816
<argument name="form_key_value" xsi:type="object">Loki\Base\ViewModel\FormKeyValue</argument>
1917
</arguments>
2018
</block>
19+
</container>
20+
21+
<block name="loki.script" template="Loki_Base::script/script-container.phtml">
22+
<arguments>
23+
<argument name="cache_lifetime" xsi:type="number">86400</argument>
24+
</arguments>
25+
26+
<block name="loki.alpinejs" template="Loki_Base::script/alpine-csp.phtml"/>
2127

2228
<block name="loki.script.cookies" template="Loki_Base::script/cookies.phtml">
2329
<arguments>
2430
<argument name="cookie_config" xsi:type="object">Loki\Base\ViewModel\CookieConfig</argument>
2531
</arguments>
2632
</block>
27-
</container>
33+
</block>
2834

2935
<block name="loki.script.store" template="Loki_Base::script/script-container.phtml">
3036
<arguments>
@@ -41,16 +47,30 @@
4147
</block>
4248

4349
<block name="loki.script.directive" template="Loki_Base::script/script-container.phtml">
50+
<arguments>
51+
<argument name="cache_lifetime" xsi:type="number">86400</argument>
52+
</arguments>
53+
4454
<block name="loki.script.directive.autoremove" template="Loki_Base::script/directive/autoremove-directive.phtml"/>
4555
</block>
4656

4757
<block name="loki.script.component-partial" template="Loki_Base::script/script-container.phtml">
58+
<arguments>
59+
<argument name="cache_lifetime" xsi:type="number">86400</argument>
60+
</arguments>
4861
</block>
4962

5063
<block name="loki.script.component-type" template="Loki_Base::script/script-container.phtml">
64+
<arguments>
65+
<argument name="cache_lifetime" xsi:type="number">86400</argument>
66+
</arguments>
5167
</block>
5268

5369
<block name="loki.script.component" template="Loki_Base::script/script-container.phtml">
70+
<arguments>
71+
<argument name="cache_lifetime" xsi:type="number">86400</argument>
72+
</arguments>
73+
5474
<block name="loki.component.messages" template="Loki_Base::script/component/message-component.phtml"/>
5575
</block>
5676
</referenceContainer>

0 commit comments

Comments
 (0)