File tree 3 files changed +54
-0
lines changed
app/code/Magento/PageCache
3 files changed +54
-0
lines changed Original file line number Diff line number Diff line change
1
+ <?php
2
+ /**
3
+ *
4
+ * Copyright © Magento, Inc. All rights reserved.
5
+ * See COPYING.txt for license details.
6
+ */
7
+
8
+ declare (strict_types=1 );
9
+
10
+ namespace Magento \PageCache \Plugin ;
11
+
12
+ use Magento \Framework \App \FrontControllerInterface ;
13
+ use Magento \Framework \App \Response \HttpInterface ;
14
+
15
+ class AppendNoStoreCacheHeader
16
+ {
17
+ /**
18
+ * Set cache-control header
19
+ *
20
+ * @param FrontControllerInterface $controller
21
+ * @param HttpInterface $response
22
+ * @return HttpInterface
23
+ * @SuppressWarnings(PHPMD.UnusedFormalParameter)
24
+ */
25
+ public function afterDispatch (FrontControllerInterface $ controller , HttpInterface $ response ): HttpInterface
26
+ {
27
+ $ response ->setHeader ('Cache-Control ' , 'no-store ' );
28
+ return $ response ;
29
+ }
30
+ }
Original file line number Diff line number Diff line change
1
+ <?xml version =" 1.0" ?>
2
+ <!--
3
+ /**
4
+ * Copyright © Magento, Inc. All rights reserved.
5
+ * See COPYING.txt for license details.
6
+ */
7
+ -->
8
+ <config xmlns : xsi =" http://www.w3.org/2001/XMLSchema-instance" xsi : noNamespaceSchemaLocation =" urn:magento:framework:ObjectManager/etc/config.xsd" >
9
+ <type name =" Magento\Framework\App\FrontControllerInterface" >
10
+ <plugin name =" append_no_store_cache_header" type =" Magento\PageCache\Plugin\AppendNoStoreCacheHeader" />
11
+ </type >
12
+ </config >
Original file line number Diff line number Diff line change
1
+ <?xml version =" 1.0" ?>
2
+ <!--
3
+ /**
4
+ * Copyright © Magento, Inc. All rights reserved.
5
+ * See COPYING.txt for license details.
6
+ */
7
+ -->
8
+ <config xmlns : xsi =" http://www.w3.org/2001/XMLSchema-instance" xsi : noNamespaceSchemaLocation =" urn:magento:framework:ObjectManager/etc/config.xsd" >
9
+ <type name =" Magento\Framework\App\FrontControllerInterface" >
10
+ <plugin name =" append_no_store_cache_header" type =" Magento\PageCache\Plugin\AppendNoStoreCacheHeader" />
11
+ </type >
12
+ </config >
You can’t perform that action at this time.
0 commit comments