I know that there are several caching plugins for WordPress. I have 3000+ categories in one wordpress install, and when adding new ones, it sometimes takes several minutes or hours for them to show up in wp-admin manage->categories, even though they appear in mysql immediately. Is there some sort of caching at the wordpress level going on?
I see that there exists a global variable $cache_categories, but I can’t find anywhere that it actually does anything of use.
It should show instantly in the wp-admin. Either you browser isn’t updating and you need to clear it’s cache or maybe your host has some sort caching system.
It’s not my browser. I can try on different browsers on different computers and it’s the same. As of now, none of the new categories from the last couple days have shown up in admin-manage or if I list all the categories in the sidebar with hide_empty=0.
I host it myself on a LAMP server. There’s no caching system on the server for this sort of thing.
The highest term_id in the Terms table is 3537. There are actually 3,470 records. (I’ve deleted some along the way.) What does wordpress use to determine how many categories there are? Obviously it’s not just looking at how many records there are in the table.
If I add a new parent category, it shows up just fine. However, if I add a new child category, it’s not showing up in manage categories although it’s showing up in phpmyadmin. It does have the correct parent category id in phpmyadmin.
I have 3000+ categories
It’s quite likely that nobody has ever tested WordPress with such an insane number of cats, so I’m not surprised that it doesn’t work.
There are not 3000 categories of things to talk about in the entire world. What in the heck are you using that many categories for? Perhaps you should use tags instead.
I figured I was probably the first to ever attempt such a crazy thing:)
If I use tags, is there a method of having a hierarchy?
Ah, no, tags are not hierarchical.
You could try enabling the object cache. WordPress does not use it by default. Add this to the wp-config.php, after the other defines but before the includes.
And make sure that the wp-content/cache directory is writable. WordPress will cache results of a lot of queries into here, and when it finds them, it will use these instead. It is debatable how much performance this helps. In many cases, it hurts performance, but sometimes it’s still useful.
Note that if you do have it enabled already, then this could be the problem with the cats not showing up in your lists. Delete the contents of the wp-content/cache directory, see if that clears up the issue. In which case, you could remove the ENABLE_CACHE line from the wp-config to disable the object cache.
Should I have a wp-content/cache directory? or do I need to make it. I’ve never had one.
Nevermind I made it.
ok so I can see where it’s creating a cache there, but the same categories (the last 200 or so third level ones) still aren’t showing up in admin or on the site’s front.
Well then, I don’t know what to tell you. Don’t make that many categories. There’s no caching as such, but you may be hitting a PHP memory limit or something.
There has got to be a logical reason why they aren’t showing up.
I increased it to 32m a while back. Surely it doesn’t need to be 64M?
Hey, with 3000 categories, who knows? You’re trying to load a literally ridiculous amount of rows into memory. It’s entirely possible that you exceeded 32 megs. WordPress usually loads all the query results into memory immediately, then loops through them, as opposed to loading them into memory only when they are needed. This is for speed reasons, the database is usually on a different server and loading stuff from it is the long part of that operation.
Again, seriously, rethink your plan here. Having 3000 categories is insane. WordPress was not designed for that. It will not work well with that. Heck, having more than 100 categories would be pushing it, in my opinion.
If you *really* need 3000 hierarchical categories, I would say that you need a professional coder writing you something custom. Generic blogging and CMS systems are not usually designed with that in mind.
It’s possibly a plugin that is interfering somehow. There are about a dozen or so installed. I also have modified the system throughout.
I installed a fresh copy of the default WordPress install in a different directory, and imported from the original. The categories didn’t all come in at first (only about 2500), I had to do it twice. Then they all came in but some of the parent-child relationships were broken.
They all show up fine on this basic install.
I don’t see how there’s any way it takes more than 32M, even if it loads everything into memory.
- The topic ‘Does wordpress have built in caching?’ is closed to new replies.