First to say, this is not a bug, but behaviour with undesired side effetcs.
I created a custom traffic logger for OpenCart, and I noticed that I get a lot url requests like
http://store.com/categoryXXX/[b]catalog ... ault/image...[/b]
http://store.com/productXXX/[b]catalog/ ... pt/jquery/...[/b]
Of course, those are invalid URLs, and that's why they were logged.
Furhter investigation showed that some browsers (I cannot tell exactly which) don't recognize the base tag, and treat relative URLs like 'catalog/view/javascript/jquery/...' relative to the current page istead of relative to the base tag and produce such invalid requests.
This resolves in calling the index.php for every invalid file, which generates a lot of server load, as it executes all SQLs, etc.
I've already solved the problem on my store http://bglotos.com/, so I'm not asking for support, just wanted to mention this for the sake of improving OC
I created a custom traffic logger for OpenCart, and I noticed that I get a lot url requests like
http://store.com/categoryXXX/[b]catalog ... ault/image...[/b]
http://store.com/productXXX/[b]catalog/ ... pt/jquery/...[/b]
Of course, those are invalid URLs, and that's why they were logged.
Furhter investigation showed that some browsers (I cannot tell exactly which) don't recognize the base tag, and treat relative URLs like 'catalog/view/javascript/jquery/...' relative to the current page istead of relative to the base tag and produce such invalid requests.
This resolves in calling the index.php for every invalid file, which generates a lot of server load, as it executes all SQLs, etc.
I've already solved the problem on my store http://bglotos.com/, so I'm not asking for support, just wanted to mention this for the sake of improving OC
care to share how you solved the problem?
OpenCart commercial mods and development http://spotonsolutions.net
Layered Navigation
Shipment Tracking
Vehicle Year/Make/Model Filter
I set inside all controllers whose templates require an absolute path, and then instead of I use
The change is required also for all css and js files.
Then, for the ajax requests I have declared a global "base" variable in the head, so all ajax request become
I guess the $base variable can be made public, I'm not sure how to do this, there's already an existing document->base variable
Code: Select all
$this->data['base']
Code: Select all
'catalog/...'
Code: Select all
'<?php echo $base; ?>catalog/...'
Then, for the ajax requests I have declared a global "base" variable in the head, so all ajax request become
Code: Select all
url: base + 'index.php?route=...'
how does this make browsers that don't use base use base if all you did was hard code the variable?alexmitev wrote:I setinside all controllers whose templates require an absolute path, and then instead ofCode: Select all
$this->data['base']
I useCode: Select all
'catalog/...'
The change is required also for all css and js files.Code: Select all
'<?php echo $base; ?>catalog/...'
Then, for the ajax requests I have declared a global "base" variable in the head, so all ajax request becomeI guess the $base variable can be made public, I'm not sure how to do this, there's already an existing document->base variableCode: Select all
url: base + 'index.php?route=...'
OpenCart commercial mods and development http://spotonsolutions.net
Layered Navigation
Shipment Tracking
Vehicle Year/Make/Model Filter
this was fixed in 1.5.1.1
the problem was there were some missing files and using seo urls.
it was fixed by removing the js links to the missing images.
might be better using htaccess to ignore requests for missing images.
the problem was there were some missing files and using seo urls.
it was fixed by removing the js links to the missing images.
might be better using htaccess to ignore requests for missing images.
OpenCart®
Project Owner & Developer.
Daniel, I think you don't understand the issue. I didn't get requests only for missing files, but for files that were actually on the server, but got requested with the wrong url. And those wrong requests were 90% of all requestsDaniel wrote: this was fixed in 1.5.1.1
the problem was there were some missing files and using seo urls.
it was fixed by removing the js links to the missing images.
might be better using htaccess to ignore requests for missing images.
I see the online demo still uses the base tag, maybe it's not current?
Correct me if I'm wrong.
I think it's better not to create such requests instead of ignoring them in the htaccess file (I have to put all gif, jpg, bmp, png, css, js files there, and index.php too!)
LOL base tag causing high server loads. Its not going to be the case as Daniel has stated.
You need to start looking at what could be the problem. Mysql slow query logging could be a good place to start to see if there is anything database related which would send the cpu high.
You need to start looking at what could be the problem. Mysql slow query logging could be a good place to start to see if there is anything database related which would send the cpu high.
opencart 3.0.2.0
As I said, the only change I made was use absolute instead of relative URLs and remove the base tag, and the wrong requests are gone! So for me it's obvious what's causing the problems.rpmb wrote:LOL base tag causing high server loads. Its not going to be the case as Daniel has stated.
Once again, it's such a pin in the a** convincing you to improve OC.. as always. I guess I'll just stop reporting isses.
you not helping me improve opencart because you don't know what you are talking about.
if something is missing and causing the high cpu loads then find what is missing then remove the code for it.
the base tag is required. if you remove it you will find other things might stop working.
if you are using seo urls with a missing base tag this will cause problems.
ie6 and ie7 are trying to load transparent images that don;t exists and being redirect to the homepage. this only happens when seo urls are on. this is whats causing the problem. i have already moved the links to these files in the latest version.
try using fiddler to find out exactly what is causing the problem instead of using uneducated guess work.
i don;t have time to fully explain how wrong your suggestion is.
when you know programming then come back.
if something is missing and causing the high cpu loads then find what is missing then remove the code for it.
the base tag is required. if you remove it you will find other things might stop working.
if you are using seo urls with a missing base tag this will cause problems.
ie6 and ie7 are trying to load transparent images that don;t exists and being redirect to the homepage. this only happens when seo urls are on. this is whats causing the problem. i have already moved the links to these files in the latest version.
try using fiddler to find out exactly what is causing the problem instead of using uneducated guess work.
i don;t have time to fully explain how wrong your suggestion is.
when you know programming then come back.
OpenCart®
Project Owner & Developer.
Who is online
Users browsing this forum: No registered users and 4 guests