[PROBLEM] A page is constantly refreshing

#21
Yes, cache function is cache plugin. :)

If the issue is solved if you disable the cache, that can mean that one of your plugins is not cache friendly.

I'll tell you what I would do in your place. Deactivate all plugins except for the cache plugin, purge the cache and test whether the problem still occurs. If not, activate each plugin individually and after each activation of the respective plugin, purge the cache again and test if the problem occurs. You repeat this step after each plugin activation to find out which plugin is causing the problem. Understood everything?

clearly)) I ll try, right now
 
#22
Yes, cache function is cache plugin. :)

If the issue is solved if you disable the cache, that can mean that one of your plugins is not cache friendly.

I'll tell you what I would do in your place. Deactivate all plugins except for the cache plugin, purge the cache and test whether the problem still occurs. If not, activate each plugin individually and after each activation of the respective plugin, purge the cache again and test if the problem occurs. You repeat this step after each plugin activation to find out which plugin is causing the problem. Understood everything?

Iv checked all plugins they are the same like origin version.. All list step by step. Nothing to turn off .. hmmm Origin works good
clear.rum-opt.ru
 

serpent_driver

Well-Known Member
#23
Nothing to turn off .. hmmm Origin works good
This is not good. Then I see the only way to delete the plugins, at least temporarily. Otherwise you will never find out which plugin is causing it. If it were a PHP problem it would be easier, but not if it's a Javascript problem, which inevitably has to be a Javascript problem because the suspected cause is probably an AJAX request causing the problem through caching.
 
#26
function cartUpdate(){
$.ajax({
url: 'index.php?route=checkout/cart/editCart',
type: 'post',
data: $(".checkout-cart input[type=\'number\']"),
dataType: 'json',
success: function(json) {
if (json['success']) {
console.log(json);
setTimeout(function () {
$(".mobile_menu .navigation .item.cart .quantity").html(json['total_short']);
$("header .body .main_cart span").html(json['total_short']);
$(".checkout-cart__total-count").html(json["total_short_text"]);
$(".checkout-cart__sub-total").html(json["initial_total"] + ' ₽');
$(".checkout-cart__total-discount").html(json["discount"] + ' ₽');
$(".checkout-cart__total-with-discount").html(json["total"] + ' ₽');
for (key in json['products']) {
$("input[name='quantity["+ key +"]']").parent().next().html(json['products'][key]['total'] + ' ₽');
$("input[name='quantity["+ key +"]']").parent().siblings(".checkout-cart__discount").html(json['products'][key]['discount'] + ' ₽');
}
if (json["total"] === 0) {
location.reload();
}
}, 100);
$('#cart > ul').load('index.php?route=common/cart/info ul li');
}
}
});
}
 

serpent_driver

Well-Known Member
#27
Code:
if (json["total"] === 0) {
location.reload();
}
This code at least indicates a reload of the page, but if the page is cached, the request leads to nothing and keeps repeating, or the page keeps reloading. Delete this plugin, at least temporarily, and test it, but don't forget to purge the cache.
 

serpent_driver

Well-Known Member
#29
The problem shouldn't actually occur because the AJAX request, which I had already assumed to be the cause, sends the request via POST and POST requests are normally excluded from caching, but the json is generated dynamically and leads to json["total "] === 0 and reloads the page over and over again. Do you have any plugins installed that do any optimizations when loading javascript?
 

AndreyPopov

Well-Known Member
#30
@Roman try enable in GUI settings -
Ajax Load Wishlist
Ajax Load Compare
Ajax Load Shopcart

P.S. like to LSCache documentation - these are recommended settings if ESI not available.
 
Last edited:

serpent_driver

Well-Known Member
#32
this is standard js library from Opencart that also loaded on "clear"
Yes, the AJAX method is a fallback method for missing ESI and works normally, but obviously not in this case. However, the OC shop seems to be heavily modified, so I think it's impossible to solve the problem via a forum. To do this, you would need access to the installation.
 
Top