WordPress Transients For Caching Social Media Counts Not Can Reduce Webpage Loading Time and Server Load on Our Side and on the Social Networking Websites’ Servers. Previously we wrote How Pinterest is a Big Lesson on Scalability – that is a great practical demonstration of our networking skill (terminology is intended to indicate Computer Networking not human habit). But, we must use the latest technologies to save resources of others, when actually we can do it for Free of Cost.
Most Social Networking Websites, specially Twitter uses Cache server, still additional caching of data on Client End (that is our side) can reduce the consumption of Electricity. We are talking about Green Things now, you can WordPress Transients For Caching Social Media Counts from that angle.
WordPress Transients For Caching Social Media Counts : What is This Heck?
WordPress Transients For Caching is not new idea. WordPress Transients For Caching Social Media Counts is relatively new idea, there is no WordPress Plugin which effectively does Fragment Caching of the Counts. We at least use :
- Facebook button
- Twitter button
- Pinterest button
- Google Plus button
Asynchronous loading helps for dynamic delivery of content to the user, this is not the answer to the cumulative load on the Servers (of Origin). HTML5 CSS3 Custom Social Sharing Buttons For WordPress With Sharrre is the most advanced technology in use right now, but the count ultimately puts burden on the Origin Server.
Look at this webpage – What Camera Mode to Choose Depending on the Situation?
Only Pinterest count alone is 3K+ for one Post. Most social media, for over 1000 such actions, switches to active serving of Cached counts. Normal phenomenon – if you click on 230, it should change to 231 immediately; one hit on 3K+ count can be allowed to take a bit time to display the latest exact count on the client side. If you think it is only a burden to the social media’s server, you are quite wrong.
Unfortunately, we have no universal content management system for all type of websites. On our side, that is Client side, we usually use WordPress. That is great enough to :
- Decrease Page Loading Time
- Decrease Burden on Servers/Nodes on both sides
We have talked about the basics on Transient and WordPress; WordPress Transients For Caching etcetera topics; also we recommend to read Mark Jaquith’s post on Fragment Caching in WordPress :
WordPress Transients For Caching Social Media Counts : Basics
An example can be provided with Facebook, copy paste the thing and run on your Browser’s new Window :
Another example without JSON conversion :
Please check Facebook’s API Documentation. Practically, all social network has some sort of such function. Because, 3K+ or 03 is Not important to you as a reader, but for them; it is a serious matter. Usually the origin Server’s Cache is flushed when a new Like (or equivalent) is given. So, basically we are asking a Third Party Server for a Data, that is already known.
In other words, if you Cache this data for 15 minutes on your server, it will :
- Reduce Page Loading Speed as at least 4 different webservers for 4 different button count will not be asked on each page load
- Reduce burden on Origin Server
- Reduce burden on Client Server too
A Typical example is given with FeedBurner Feed, this is what is intended to be at the backend :
On the frontend of WordPress, this retrieves the data :
Obviously as we are going to use these for different profiles, we will have to wrap these up in a single class – take an example name $social-counts. Yes, definitely there is a lot of coding involved.