Support Forum

Advanced Search
Forum Scope


Match



Forum Options



Minimum search word length is 3 characters - maximum search word length is 84 characters
news-topic
Develop a plugin to leverage persisten object caching (redis, memcache...)
Avatar
Blaise
Member
Pro Subscribers
sp_UserOfflineSmall Offline
Dec 16, 2016 - 8:59 am
sp_QuotePost Quote

Hi,

If I may make a performance enhancing suggestion:

Simple press is heavy on database calls: about 70 different calls for a topic page. 

I see you have a cache system in place, but it's also calling the database 🙂 

So how about developing a plugin which takes advantage of the built-in object caching in wordpress? Object caching is a default wordpress function and looking at your code adding the option in your cache-api for object caching seems pretty straightforward and should benefit performance (provided of course the user has persistent object cache enabled). Again, this is only if the user has Redis, Memcache or APCu enabled on the server.

It's all about wp_cache_set, wp_cache_get and wp_cache_delete 

You could start with your cache-api, but there's lots of other calls which could nicely be put in object cache such as newposts tracking or even user profile. 

Avatar
Yellow Swordfish
Glinton, England
SP Master
sp_UserOfflineSmall Offline
Dec 16, 2016 - 4:05 pm
sp_QuotePost Quote

Caching is not so easy with forum data. You have to remember that the data served up in any view, is totally personalised to the user making the request. What is good for you to see is almost certainly not right for the next person to request that sane view.

Not only may their permissions be different, but their unread post list is going to be different - they may even sort the forum view differently or have adversaries set whose posts they do not want to see. 

Ad admin or moderator user may be able to see posts awaiting moderation but a user must not. If the data comes out of a cache it is almost always going to be incorrect.

We perform some caching where we can and are always looking to improve that but not at the expense of serving incorrect data. And these days, a mySQL database is perfectly capable of serving large numbers of queries and, will create table level caches of it's own so often much is being done in memory.

We are obviously well aware of any caching options provided by WP but there is no safe way to use them.

andy-signature.png
YELLOW
SWORDFISH
Forum Timezone: Europe/Stockholm
Most Users Ever Online: 1170
Currently Online:
Guest(s) 1
Currently Browsing this Page:
1 Guest(s)
Top Posters:
Mr Papa: 19448
Ike: 2086
Brandon: 864
kvr28: 804
jim: 650
FidoSysop: 577
Conrad_Farlow: 531
fiddlerman: 358
Stefano Prete: 325
Member Stats:
Guest Posters: 620
Members: 17365
Moderators: 0
Admins: 4
Forum Stats:
Groups: 7
Forums: 17
Topics: 10128
Posts: 79626