Just a quick update for those who are following developments for my AZIndex plugin (is there anybody out there… there… there… ?).
Anyway, it looks like I have a viable caching solution almost completed, and the speed improvements are quite gratifying. I have created several test indexes containing over 1100 items and the index pages load anywhere from 4x to 50x faster when they are being cached, depending on the options set for the index.
Obviously indexes with multiple pages see the biggest gains because if you put 1000 items on one index page, the plugin still has to loaded all 1000 items from the database even though they don’t have to be sorted. Even so, a 4x speed improvement is nothing to sniff at. But if you have a large number of items in the index, it’s only natural to have them spread over multiple pages, so in most cases you will see at least a 10x improvement over a non-cached index.
I have added an option to disable caching, but I recommend against using it unless you think you might be having problems with caching, and you can reset the cache from the admin page if necessary.
How does AZIndex know when the cache is out of date? Well, it attaches to the WordPress action hooks which fire when someone saves or publishes a post. Each index maintains a dirty list of posts and pages that have changed since the cache was last rebuilt, and when the index is next display, it checks though its dirty laundry (if you will) to see if the ordering of the items has been affected by the changes, or if a post needs to be removed from or added to the index. If it does find the index needs to be updated, then it will rebuild the cache causing a one-time slower load for one very slightly unlucky user.
Hooking changes to custom fields turned out to be a pain, since there are no definitive hooks for them, and you can change them without having to save the post afterwards. In the end I attach to the Ajax hooks which fire when a user is editing a custom field. That will probably work for 99% of all custom field changes, but if a blog uses another plugin to change custom fields using the function calls, then there is little AZIndex can do to detected those changes. But in the worst case, all the blogger has to do is manually clear the cache once all the changes have been made.
So, be on the lookout for AZIndex v0.5 with full caching support sometime this week, just in time for the holiday weekend.
I was wondering if there’s an option to exclude certain pages from showing up in the index? I want to create pages for artists and have the artist names only show up, however the navigation pages I created are showing in the index as well.
Also, how do I get rid of the bullets? Thanks!
Hi Gregg,
Thanks for your questions. In finding the answers, I actually learned something about CSS today!
So, taking the bullet question first, the answer is that you’ll have to modify your theme’s stylesheet and customize the AZIndex CSS, but it’s not difficult. The problem is that you have the following entry in your theme’s stylesheet:
#content .post ul li {
list-style-type: disc !important;
}
What I didn’t know about CSS was that if you stick “!important” on the end of a line, the style will be used even if you try to override it later (which is what AZIndex tries to do, but fails). So the first thing to do is remove “!important” from that line so that it now looks like:
#content .post ul li {
list-style-type: disc;
}
Note: if you will never need bullets in your lists in your blog’s contents then you can remove the whole line and you will have fixed the problem, but if you want to keep bullets in your other lists, then follow the rest of the instructions here.
BTW: To edit the theme by going to Design >> Theme Editor and edit the theme’s stylesheet (usually called stylesheet.css or styles.css). I don’t think that removing the !important tag will affect the appearance of rest of your blog.
Now if you check your index, you will still probably see the “disc” markers on your items (in FireFox anyway). I tried a number of different CSS tweaks to the index’s CSS, but only one of them seems to work. Edit the index settings and select the Use customized stylesheets for the index option. Now scroll down to the stylesheet (make sure you select the correct one for the type of index you have — or just make the same change in both) and add the following line to the CSS:
#content .post .azindex ul li {list-style:none}
(Important: Do not remove any of the other lines!)
That should turn off those pesky bullets. I’ll continue to look out for a way to set up the default index to not have bullets even if the theme sets them for all lists, but I’m not sure I will be able to come up with one. (Sounds like a good topic for an FAQ though!).
I will post another comment shortly on your other question.
Now, regarding leaving pages out of the index. Though there is no magic option, there are a couple of ways to do this:
One of those should solve your problem. The second one (tagging the pages you want) is probably the better option, unless you want to have fine control over how the names appear in the index. There is also no reason why you can’t do both at the same time.
Let me know if you have any other questions.
Mike
A very nice plugin – easy to install and set up (and I’m a new WordPress user) I’ll be installing it on both my WP blogs. Thanks!
Thank you, Carolyn, stay tuned for updates.