Welcome to Geeklog, Anonymous Thursday, November 28 2024 @ 03:05 am EST

Geeklog Forums

URL Routing issue


Status: offline

OMAL

Forum User
Regular Poster
Registered: 12/06/17
Posts: 107
I'm using URL Routing with Enable URL Rewrite:true and Enable URL Routing:Enabled option in GL version 2.2.

The problem is that it takes few more aditional seconds to display an article page with URL Routing ON.

It may be due to having several thousands pages in the site. Anyway, I want to customize core codes to solve the issue, if possible.
How can I debug the URL Routing? Which codes do I have to look?

Thanks.
 Quote

Status: offline

Laugh

Site Admin
Admin
Registered: 09/27/05
Posts: 1470
Location:Canada
Issue has been found. For discussion see: https://github.com/Geeklog-Core/geeklog/issues/945

Geeklog doesn't have a true front control so when it first sees:

http://www.example.com/topic/Geeklog/2

It loads index.php matches the route and then reloads the page using the original URL

http://www.example.com/index.php?topic=Geeklog&page=2

The whole page doesn't load the first time but lib-common.php does and then lib-common.php loads again on the second go around. (which is where the increased time comes from)

What needs to be done instead of the second page load is we require_once the required file in the same page load and hopefully everything will continue to load fine. (will have to make sure the url variables are retrieved fine as this may need some fixing).

I forget all the files but their is a router.class.php that is the main file found in system/classes/

I had planned to fix this in September sometime but you are more than welcome to take a look and post any fixes.
One of the Geeklog Core Developers.
 Quote

Status: offline

OMAL

Forum User
Regular Poster
Registered: 12/06/17
Posts: 107
Quote by: Laugh

Issue has been found. For discussion see: https://github.com/Geeklog-Core/geeklog/issues/945

Geeklog doesn't have a true front control so when it first sees:

http://www.example.com/topic/Geeklog/2

It loads index.php matches the route and then reloads the page using the original URL

http://www.example.com/index.php?topic=Geeklog&page=2

The whole page doesn't load the first time but lib-common.php does and then lib-common.php loads again on the second go around. (which is where the increased time comes from)

What needs to be done instead of the second page load is we require_once the required file in the same page load and hopefully everything will continue to load fine. (will have to make sure the url variables are retrieved fine as this may need some fixing).

I forget all the files but their is a router.class.php that is the main file found in system/classes/

I had planned to fix this in September sometime but you are more than welcome to take a look and post any fixes.



Currently, I have no time. But I'll take a look in any case.
Practically, index.php is the most popular page in the site on which I am concerned about the issue, so fixing routing performance for most 10 recent articles could be solution with best effort.
 Quote

Status: offline

Laugh

Site Admin
Admin
Registered: 09/27/05
Posts: 1470
Location:Canada
BTW I just fixed the routing issue. See this commit on the latest code in the repository for the changes: https://github.com/Geeklog-Core/geeklog/commit/3da77a9a6cfd2d0a318c24f124ef6df9edd4be7e
One of the Geeklog Core Developers.
 Quote

All times are EST. The time is now 03:05 am.

  • Normal Topic
  • Sticky Topic
  • Locked Topic
  • New Post
  • Sticky Topic W/ New Post
  • Locked Topic W/ New Post
  •  View Anonymous Posts
  •  Able to post
  •  Filtered HTML Allowed
  •  Censored Content