File tree Expand file tree Collapse file tree 3 files changed +1
-40
lines changed
app/code/Magento/Customer Expand file tree Collapse file tree 3 files changed +1
-40
lines changed Original file line number Diff line number Diff line change 7
7
8
8
class CustomerData extends \Magento \Framework \View \Element \Template
9
9
{
10
- /**
11
- * Sections that can not be cached on frontend-side
12
- *
13
- * @var array
14
- */
15
- protected $ nonCachedSections = [];
16
-
17
10
/**
18
11
* @param \Magento\Framework\View\Element\Template\Context $context
19
12
* @param array $data
20
- * @param array $nonCachedSections
21
13
*/
22
14
public function __construct (
23
15
\Magento \Framework \View \Element \Template \Context $ context ,
24
- array $ data = [],
25
- array $ nonCachedSections = []
16
+ array $ data = []
26
17
) {
27
- $ this ->nonCachedSections = $ nonCachedSections ;
28
18
parent ::__construct ($ context , $ data );
29
19
}
30
20
@@ -50,24 +40,4 @@ public function getCustomerDataUrl($route)
50
40
{
51
41
return $ this ->getUrl ($ route , ['_secure ' => $ this ->getRequest ()->isSecure ()]);
52
42
}
53
-
54
- /**
55
- * Get sections that can not be cached on frontend-side
56
- *
57
- * @return array
58
- */
59
- public function getNotCachedSections ()
60
- {
61
- return $ this ->nonCachedSections ;
62
- }
63
-
64
- /**
65
- * Get keys of sections that can not be cached on frontend-side
66
- *
67
- * @return array
68
- */
69
- public function getNonCachedSectionKeys ()
70
- {
71
- return array_keys ($ this ->nonCachedSections );
72
- }
73
43
}
Original file line number Diff line number Diff line change 13
13
'* ' => ['Magento_Customer/js/customer-data ' => [
14
14
'sectionLoadUrl ' => $ block ->getCustomerDataUrl ('customer/section/load ' ),
15
15
'cookieLifeTime ' => $ block ->getCookieLifeTime (),
16
- 'nonCachedSections ' => $ block ->getNonCachedSectionKeys (),
17
16
]],
18
17
]);
19
18
?>
Original file line number Diff line number Diff line change @@ -23,8 +23,6 @@ define([
23
23
storage . removeAll ( ) ;
24
24
var date = new Date ( Date . now ( ) + parseInt ( options . cookieLifeTime , 10 ) * 1000 ) ;
25
25
$ . localStorage . set ( 'mage-cache-timeout' , date ) ;
26
- } else {
27
- invalidateNonCachedSections ( options ) ;
28
26
}
29
27
} ;
30
28
@@ -35,12 +33,6 @@ define([
35
33
}
36
34
} ;
37
35
38
- var invalidateNonCachedSections = function ( options ) {
39
- _ . each ( options . nonCachedSections , function ( sectionName ) {
40
- storageInvalidation . set ( sectionName , true ) ;
41
- } ) ;
42
- }
43
-
44
36
var dataProvider = {
45
37
getFromStorage : function ( sectionNames ) {
46
38
var result = { } ;
You can’t perform that action at this time.
0 commit comments