I am currently in the process of optimizing my site. I noticed that I am having duplicate queries with this plugin. It seems that calls are duplicated 6 times per page load.
I am using Query Monitor to see these queries.
These duplicate queries are:
SELECT * FROM wp_terms WHERE slug = 'necessary'
SELECT * FROM wp_terms WHERE slug = 'obligatoire'
This brings up some concerns:
1. Why don’t you just make a single query to fetch these slugs? Multiple queries just for a slug change is not optimized at all. Although this is a minor issue since these queries are fast, it still has extra cost and larger systems need to optimize where they can. This just seems inefficient to me.
2. Why not use cache? Setting this to a transient would yield better results. Even using the cache object in WP (non-persistent caching) would be better than making 6 queries per check.
3. Why the need to do these queries 6 times per page load?
- The topic ‘Duplicate Queries’ is closed to new replies.