CM Tooltip (CMTG) - Troubleshooting - Managing Large Glossaries
Managing Large Glossaries - Basics
- Glossary Index Page takes too long to load - Change to Server-Side pagination and limit the amount of terms on one page to 50-100 (maybe 200 on more powerful servers)
- Terms in posts/pages take too long to be highlighted - More terms, including synonyms, variations and abbreviations, means slower parsing. We suggest dividing terms into categories and using the Term whitelist/blacklist on each post/page to reduce the amount of terms for that content.
While some glossaries are relatively small, some may grow pretty big. In these cases, the performance hit caused by the parser may become significant, even when the plugin is optimized.
In this article, we'll cover optimization techniques.
Can I Have "Too Many" Terms?
The pro version of Tooltips Glossary does not limit the number of terms you can have. However, having a large number will tax your servers.
Internal tests and reports suggest that, on average, most glossaries don't struggle with performance at all. We can use the following table as a baseline.
- Small glossary 1-500 terms → No optimization should be necessary
- Big glossary 501-1000 terms → Some optimization may improve performance
- Huge glossary 1000+ terms → Optimization might be necessary
Ways to Optimize Index Page
Thankfully there are always things one can do to improve the performance by some degree.
Enable server-side pagination
Navigate to Admin Dashboard → CM Tooltip Glossary → Settings → Glossary Index Page tab.
Scroll down to the Pagination section.
- Paginate Glossary Index page (items per page) - Set a number lower than 100 in items per page. The lower, the faster the index will load.
- Pagination type - Choose server-side pagination.
Note: Pagination will only work if the index setting Number of items per letter (0 for no limit) is turned off. Learn more:
Divide the glossary into categories
- Divide the same glossary into different sections Terms - Using Categories - Dividing Glossary Into Sections
- Or use multiple glossaries Terms - Building Multiple Glossaries
After Changes: Enable CachingNavigate to Admin Dashboard → CM Tooltip Glossary → Settings → General Settings tab → Performance & Debug section.
Turn on the option Enable the caching mechanisms, which tries to reuse the information once stored instead of obtaining them all the time.
Please keep in mind that it's best to only enable the plugins internal cache after you've made all of the changes on the glossary on your site.
Ways to Optimize All Pages
Limit parsing of the tooltip
- Choose to only highlight the first term occurrence on each page
- Exclude certain tags from parsing, such as h2 or div
- Whitelist and blacklist terms on certain pages based on category
Learn more Terms - Controlling Where Tooltip Appears
Remove related articles
One of the things which the plugin does that can have a significant hit on performance is the related articles functionality.
If you're not using it, or can't afford the performance loss, you can follow the Related Articles - What are They and How to Add Them.
Install a cache plugin
If your content doesn't change often (or not at all) it's unnecessary to parse the content in search for the tooltips over and over again. Using a caching plugin which will store the rendered HTML and serve it to the users can save the server a lot of load, as it won't need to make unnecessary calls to the database and process the PHP parsing.
We recommend using the W3TC plugin and to request help from someone who is knowledgeable in configuring this plugin for the best performance.
Everybody knows that some computers are faster than the others, the same applies to the web servers.
Usually, the cheapest shared hosting won't run on the best machines, so if you're planning to create a huge glossary, you may need to consider spending a bit more money on your own hosting (VPS or even a dedicated server) with a lot of RAM, fast disks and good processors.
Use External Cache services
There are several services which offer improved caching such as CloudFlare or built in server solution such as warm cache solution that speed up the page serving.
They replace your site in terms of serving the pages on your site and caching them every set amount of time. This will of course reduce the amount of time the plugin parser is used.