Skip to content

Commit f0b1e02

Browse files
MC-4277: Address Product Page slowness due to 'product_data_storage' handling
1 parent 8487750 commit f0b1e02

File tree

3 files changed

+3
-7
lines changed

3 files changed

+3
-7
lines changed

app/code/Magento/Catalog/view/frontend/web/js/product/storage/data-storage.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ define([
118118
if (_.isEmpty(data)) {
119119
this.localStorage.removeAll();
120120
} else {
121-
this.localStorage.set(data);
121+
window.localStorage.setItem(this.namespace, JSON.stringify(data));
122122
}
123123
},
124124

app/code/Magento/Catalog/view/frontend/web/js/product/storage/ids-storage.js

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -94,11 +94,7 @@ define([
9494
* Initializes handler to "data" property update
9595
*/
9696
internalDataHandler: function (data) {
97-
var localStorage = this.localStorage.get();
98-
99-
if (!utils.compare(data, localStorage).equal) {
100-
this.localStorage.set(data);
101-
}
97+
window.localStorage.setItem(this.namespace, JSON.stringify(data));
10298
},
10399

104100
/**

app/code/Magento/Catalog/view/frontend/web/js/product/storage/storage-service.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ define([
4747
* @param {*} data
4848
*/
4949
add: function (data) {
50-
if (!_.isEmpty(data) && !utils.compare(data, this.data()).equal) {
50+
if (!_.isEmpty(data)) {
5151
this.data(_.extend(utils.copy(this.data()), data));
5252
}
5353
},

0 commit comments

Comments
 (0)