Very slow template=json

Rate this topic: Evaluations: 1, 1.00 on the average.Evaluations: 1, 1.00 on the average.Evaluations: 1, 1.00 on the average.Evaluations: 1, 1.00 on the average.Evaluations: 1, 1.00 on the average.Evaluations: 1, 1.00 on the average.1.00 out of 6 based on 1 vote(s)
GK User
Thu Mar 27, 2014 1:19 pm
Reply with quote
Report this post
i make a tv advertisement and when the shoppers come to see the site the site is overload the server with request for

index.php?tmpl=json&lang=el

it was about 50 requests /sec

and this is take 20-30 sec to load i thinks this template is not for many users ...this tmpl=json is slowing all site
User avatar
Senior Boarder

GK User
Thu Mar 27, 2014 9:07 pm
Reply with quote
Report this post
Hello,

This file is used to update the counter near the cart. You can try to increase the refresh data time in file js/gk.scripts.js by changing fragment:

Code: Select all
setTimeout(function() {
   gkCartDataRequest();
}, 5000);


to:

Code: Select all
setTimeout(function() {
    gkCartDataRequest();
}, 15000);
User avatar
Administrator

GK User
Fri Mar 28, 2014 8:18 am
Reply with quote
Report this post
I was change this at index.php?lang=el its take 30 sec to load when is 10 shoppers inside the same time many requests and many apache load ...
User avatar
Senior Boarder

GK User
Fri Mar 28, 2014 10:00 am
Reply with quote
Report this post
In this case the only solution will be removing the following code fragment from the gk.scripts.js file:

Code: Select all
if(btn) {
                   var counter = new Element('i', { 'id': 'gkCartCounter'});
                   counter.inject(btn);
                   var gkCartDataRequest = function() {
                       new Request.HTML({
                           url: $GK_URL + 'index.php?tmpl=json',
                           onSuccess: function(nodes, xml, text) {
                               document.id('gkCartCounter').set('text', '(' + text + ')');   
                           },
                           onComplete: function() {
                              setTimeout(function() {
                                 gkCartDataRequest();
                              }, 5000);
                           }
                       }).send();   
                    }
                    gkCartDataRequest();
                }
User avatar
Administrator


cron