Custom Permalink DRAMATICALLY slows website
-
As the title says. Using a custom permalink structure will dramatically slow down the website. Its nice having relevant permalinks that give structure, but is it worth it? I’m trying to find a way to have both a custom permalink and optimal performance on my website.
Using “/%category%/%postname%/” as my custom permalink structure, loading my homepage takes ~3,000 queries taking ~5.0 seconds.
Using the default permalink structure (‘https://domain.com/?p=123’), loading my homepage takes ~20 queries loading in ~0.5 seconds.
To get this information and figure out which queries i am making, i added the following line to my footer to find out the #of queries and time taken to perform those:
<?php echo get_num_queries(); ?> queries. <?php timer_stop(1); ?> seconds.
And the plugin ‘Debug Queries’ to print out which queries are being ran on what page (adds info to the bottom of footer). Most of the queries look like this:
Time: 0.0001060962677002 Query: SELECT * FROM wp_posts WHERE ID = 3121 LIMIT 1 Call from: require, wp, WP->main, WP->parse_request, WP_Rewrite->wp_rewrite_rules, WP_Rewrite->rewrite_rules, WP_Rewrite->page_rewrite_rules, WP_Rewrite->page_uri_index, get_page_uri, get_page, get_post
Anyone have any ideas of how to keep the “fancy” permalink structure while maintain the performance of the default and cut down on all of those DB-Queries?
- The topic ‘Custom Permalink DRAMATICALLY slows website’ is closed to new replies.