[SOLVED] Unecessary call to /component/ajax/?format=json on every page

Started by Cococoder, October 02, 2019, 10:47:22 AM

Previous topic - Next topic

Cococoder

Hello Virtuemart community!

Joomla 3.9.12.
VirtueMart 3.6.2 10159
PHP Version   7.2.22

Browsing my access logs I noticed that component/ajax/?format=json  call where systematically followed by a /component/ajax?format=json

Looking in the source code I found this line
system.keepalive":{"interval":300000,"uri":"\/component\/ajax\/?format=json"}

in <script type="application/json" class="joomla-script-options new">

I guess it should be written: system.keepalive":{"interval":300000,"uri":"\/component\/ajax?format=json"} to avoid the redirect.

[EDIT: At the moment, I searched for the string but I only find it in the cached pages. Any idea where I can find the string to edit?
And I realize this is a Joomla issue, not a virtuemart issue, still if anyone can help ;) ]

Cococoder

In case someone find this thread, I have posted the whole troubleshooting here:
https://forum.joomla.org/viewtopic.php?f=709&t=974803&p=3582373

TLDNR: This code is generated in Line 713 in cms/html/behavior.ph by JRoute. So this where the trailing slash comes from.
I have a double call because I am using a htaccess directive to remove trailing slash from none existing directory (to avoid google index crawler to crawl and index both version of the page.
As the issue is not very accute. I'll leave it as it is now.