Not a developer? Go to MovableType.com

Plugin and Theme Directory

CacheBlock v1.0

By Mark Carey
Posted January 21, 2008, in Developer.

Details

CacheBlock is a plugin that can dramatically speed up publishing by caching blocks of built template code. CacheBlock is very flexible, enabling you to cache an entire page, a small template snippet, a template module, a sidebar widget, and entire sidebar, etc. Each block can be set to expire after a certain duration -- some blocks you may want to cache for 5 minutes, others for hours, or even days. When used wisely, the result is significantly faster publishing times and faster comment-posting.

For each page that is published by Movable Type, a large number of template tags are evaluated by the system, which often requires many database lookups. The CacheBlock plugin strives to reduce those database lookups by caching groups of template code that has already been evaluated. For example, suppose you decided to cache your entire sidebar. The first time MT publishes that sidebar, it will do many database lookups to generate lists of recent entries, comments, lists of archives and tags, etc. After that, the CacheBlock plugin will take all of that sidebar HTML and save it in the cache. The next time MT needs to publish your sidebar, it will find it in the cache, so it will skip the evaluation and related database lookups for the entire sidebar, and simply fetch the pre-built sidebar from the cache. This can speed up the process a lot. Imagine if you are trying to publish a 1000 page site, and each of those pages includes the sidebar!

Behind the scenes, CacheBlock checks to see if memcached is available and enabled. If it is, CacheBlock will stores blocks using memcached, which is very fast. BUT, you don't need to have memcached! If memcached is not available, CacheBlock will simply store the block in the database. As such, it will still require a database lookup to retrieve it from the cache, but you can save dozens or even hundreds of database lookups by caching significant segments of built template code, by replacing them with a single lookup to the cache. Even without memcached, CacheBlock can dramatically speed up publishing.

Compatibility

Movable Type versions: 4.3


Back

19 Comments

Byrne Reese on August 11, 2008, 9:46 p.m. Reply

This could not be a more insanely useful plugin. Hat’s off Mark for helping to address performance in a useful, user controllable, usable and intuitive way.

rmarley on February 19, 2009, 2:35 a.m. Reply

I think there is caching duration mainly advantage and disadvantage both are parts of this plug in but finally its a good plug in if you use it wisely. Thanks

Matt Wutzke on May 30, 2009, 3:25 a.m. Reply

Will CacheBlock work friendly with template Inheritance? Do you have any suggestions?

Mark Carey on May 30, 2009, 4:04 a.m. Reply

Yes, CacheBlock works fine with my Template Inheritance plugin. Depending on what your are trying to do, however, you may need to be very careful with your cache keys. For example, if a template is shared across multiple blogs, and it contains CacheBlock with a static cache key like ‘blogsidebar’, then that block when built by one blog will be used by all blogs, not always what you want. In such case, I suggest using cache keys that have the blogid as a prefix.

pubrecords on July 30, 2010, 1:08 a.m. Reply

Seems like a great plugin.

Heritage on March 25, 2012, 12:47 p.m. Reply

An extremely useful plugin which when used correctly can save heeps of time, well done Mark keep up the good work do you have any other projects planned.

Johny on June 14, 2012, 12:59 a.m. Reply

It’s just a must have plugin for every MT blog or news site-It’s greatly increases speed.

But there is one thing to avoid: if you have a big (I mean really massive site a.k.a portal with thousands of pages you should avoid to clear cash). If you did it you get your site slower for a few days till site pages been cashed again...

Rybalka on July 2, 2012, 1:00 a.m. Reply

Mark thank you for such a useful plugin! I like it and its very easy to use it. Appreciate your work!

fleshlight review on July 2, 2012, 4:28 a.m. Reply

I gave this a try and it actually has increased my posting and comments. Great plugin, thanks.

Peet Bannister on July 6, 2012, 7:12 a.m. Reply

Is it going to boost my storage utilization?

elsa 12 on July 17, 2012, 3:35 a.m. Reply

If I have understood this correctly it will decrease the time for my page to upload when is called from a browser. As far as I know this is one of the main factors used by Google for making their ranking. So, this plugin must be great and I am going to use it.

Ben Morrison on July 30, 2012, 8:18 p.m. Reply

It can speed up your computer :) It will speed the uploading your site when a reader go in. It is extremly helpful because the most irritating thing for a reader is to wait for a site to be uploaded. There is one more benefit. Google likes site which are fast and put them higher in SERP.

pokem23

pokem23 on December 20, 2016, 11:07 a.m. Reply

So many of the money cheats gta 5 online can allow you to get the money in your account of game.

Merlin John

Merlin John on March 23, 2017, 1:14 p.m. Reply

Building template code is little bit difficult task for me and this Cache block plugin have helped me a lot in making my work easy. I am glad to check this site with immense amount of information on various plugin features and thanks for sharing this wonderful page. my response

Merlin John

Merlin John on March 23, 2017, 1:14 p.m. Reply

Building template code is little bit difficult task for me and this Cache block plugin have helped me a lot in making my work easy. I am glad to check this site with immense amount of information on various plugin features and thanks for sharing this wonderful page. my response

maincpa77

maincpa77 on March 31, 2017, 12:56 a.m. Reply

I gave this a try and it actually has increased my posting and comments. Great plugin, thanks. http://pokemongozoner.com/

chuttad12

chuttad12 on April 8, 2017, 2:03 p.m. Reply

check this tool out if you want free gems @ clash royale free gems cheats
VĂ©rifiez cet outil si vous voulez des gemmes gratuites @ clash royale gemmes illimite

maincpa77

maincpa77 on April 10, 2017, 11:47 p.m. Reply

I was reading your GTA 5 article and wondered if you had considered creating an ebook on this subject. Your writing would sell it fast. You have a lot of writing talent http://gtaonline-argent.com.

chuttad12

chuttad12 on May 13, 2017, 11:30 a.m. Reply

read our latest online generator tool clash royale hack article here : clash royale hack no human verification also read this latrst online generator tool dokkan battle cheats article here : dokkan battle cheats

Leave a Comment