?
avatar okonomiyaki3000
okonomiyaki3000
30 Apr 2013

JHtmlBehavior::keepalive() contains the following line:

var myAjax = new Request({method: "get", url: "index.php"}).send();

This is often a bad request when using SEF urls. Say I have a page like: http://www.mysite.com/some/nested/item/. Now, when this page executes the keepalive code, it sends a request to the server for http://www.mysite.com/some/nested/item/index.php which results in either a 404 or maybe a redirect. If the 'url' field is omitted from the options object, the request will just be for the current page, which is probably what we really want.

I haven't quite gotten to the bottom of it yet but something about this code seems to (sometimes) result in multiple requests per second being made to the server. It can get pretty intense and actually drive the CPU usage up dramatically on weaker servers.

avatar okonomiyaki3000 okonomiyaki3000 - open - 30 Apr 2013
avatar okonomiyaki3000
okonomiyaki3000 - comment - 30 Apr 2013

Oh, one more thing. This function was part of the Joomla Platform but seems to be gone from the Joomla Framework so what's the story with it? Is it going away completely or becoming part of the cms library or something else?

avatar mahagr
mahagr - comment - 9 May 2013

The issue is in how Joomla sets tag in the header. Basically the line in:

https://github.com/joomla/joomla-cms/blob/master/includes/application.php#L199

breaks all relative URLs and causes a lot of complications. In Kunena we make base url empty to greatly simplify the anchor links in our pages and there seems to be no side effect of doing so.

avatar okonomiyaki3000
okonomiyaki3000 - comment - 12 Jun 2013

@mahagr Well sure but changing the base url at this point would probably cause some issues. There are simpler ways to fix this.

What happens in Kunena if you install in some subdirectory? Like: www.mygreatkunenasite.com/actuallinstallationdir/

Do your links still work?

avatar mahagr
mahagr - comment - 13 Jun 2013

Yes, they work just fine. But you're right that base should in reality point to Joomla base directory to get all relative links to work.

avatar okonomiyaki3000
okonomiyaki3000 - comment - 13 Jun 2013

Well, maybe we should look into that. I've never been too crazy about the way Joomla deals with relative links. It's kind of hacky. But this is not really the issue with the keepalive code.

avatar elinw
elinw - comment - 13 Jun 2013

I think we need to fix the issue but also there was a reason this was done during the 1.5 release. I'm trying to remember the details, but it definitely was solving a problem. I'm going to see if I can find out what it was.

avatar brianteeman
brianteeman - comment - 13 Oct 2013

Thanks for reporting this. At this time we are only using github as the place to submit code fixes so I am closing the report here. The actual reporting of issues and testing fixes is still taking place on Joomlacode.

As it has been some time since you opened this issue can you please confirm that it is still valid with the current Master or Joomla 3.2 beta.

If it is still valid please can you open an item on the Joomlacode tracker in the appropriate area.

CMS Bug Reports: http://joomlacode.org/gf/project/joomla/tracker/?action=TrackerItemBrowse&tracker_id=8103

CMS Feature Requests: http://joomlacode.org/gf/project/joomla/tracker/?action=TrackerItemBrowse&tracker_id=8549

avatar zero-24 zero-24 - close - 13 Oct 2013
avatar zero-24 zero-24 - change - 7 Jul 2015
Labels Added: ?
Removed: ? ?
Build staging

Add a Comment

Login with GitHub to post a comment