Optimizing Movable Type's Standard Templates for Speed (part 2)

| 130 Comments | No TrackBacks |
In the previous article in this series I talked about how you can set publication of certain templates to 'Manually' to speed up publishing of your blog.  Today will discuss setting up caching and server side includes, and the reasons for using them.  The first reason is pretty important: if you don't use them the sidebar(s) on most of your Movable Type blog will constantly be out of date if you are using the default templates.
Why is your sidebar out of date?

This has to do with Movable Type's static publishing model.  In the default template set, the templates that determine the look and content of your archives (category, monthly, entry...) are only used to produce actual HTML files at the time when entries (or comments) are added that would affect these HTML files.

In other words, if an entry or comment gets added today in the category 'Sports', the archive page for February 2007 or the category page for 'News' will not be changed.

Normally, this is great: only updating the pages that need an update makes things go faster, and faster is better, right?  But what about sidebars?  By default, your sidebar might include things like recent comments, a list of your archives, a list of your categories (with the number of entries in each category) and many other things.

Most of this stuff is included through the 'Sidebar' template module, which in turn includes one or more widgets via a widgetset.  But because of the static publishing model, the sidebar is included only at the time of publication and remains 'frozen' ever after, until a new publication takes place.

And that is why your archives from two years ago still contain the most recent comments from two years ago and an overview of your categories as they were back then.

How to solve this?

You could republish your entire blog after each entry you publish.  (Don't laugh, I know people who do this).  But this is horribly inneficient and can take a very long time on blogs with hundreds or thousands of entries.  Not only do you have to publish tons and tons of HTML pages, but for each page that includes the sidebar Movable Type needs to recalculate the entire contents of it, over and over again.

So obviously it is not the way to go.

If only there was a way to calculate certain content only once, and to include it on all pages but serve it from a single source so it stays up to date everywhere.

Well, actually there is such a way...

Module caching and server side includes

In the settings of your blog you will see this option:

settings.jpg

Depending on what type of Server Side Includes are possible on your server, pick the one that works on yours and enable module caching.  (If no Server Side Includes are allowed on your server, just leave it off.  Your sidebars etc. will unfortunately remain out of date until you republish the entire blog.  But at least it will go a bit quicker thanks to Module Caching if you follow the next steps.)

Next, open Design > Widgets in your blog's menu.  Check the widgets that you are using in your sidebar(s) and open them one by one.  At the bottom of each one, you will see a 'Template Options' block that you can click open:

templateoptions.jpg
 
Now follow these steps:
  1. Does the content that this widget produces need to stay up to date in your archives etc?, and will it be the same everywhere?  If the answer is 'Yes', check the box to process it as an include.
  2. Does this content ever change?  If no, set the caching options to expire after x minutes (or hours)...
  3. If the content does change, set the cache to expire upon creaton or modification of whatever causes the changes...
For example, on this blog I am using the 'Search' module in my sidebar.  This will basically never change during the lifetime of this blog, unless I am totally restyling it.  So I have set it to be cached for 30 minutes.

I am aso using the 'Recent Comments' widget, which I have set to be processed as an SHTML include and to be cached until a new comment comes in.  The same goes for my 'Category' and 'Monthly Archives' widgets, only these are cached until a new entry is added to the blog.

The result

Entries and comments on this blog are published just a bit quicker since most of the contents of the sidebar now only need to be calculated once, instead of separately for the main page of the blog, the individual page with the entry, the category archive of the entry, the monthly archive of the entry...

Also, the parts of the sidebar that need to be up to date everywhere on this site (recent comments, montly archives, list of categories with number of entries in them) are up to date everywhere, all the time.


No TrackBacks

TrackBack URL: https://www.movabletips.com/cgi-bin/mt/mt-tb.cgi/33

130 Comments

Module caching good way to make faster blog. I used it. SSI is next step.

What about Comments Template? If I set it to be cached, then what? Will the comments for each page be stored in separate file and this file be rebuilt each time new comment is posted?

Reported that senior officials rushed to Xinjiang and Central exerc ray ban pas cher ises indicate that the "7 5" incident on the hollister eve of the fourth anniversary of Beijing, as stable as top priority.

7 o'clock yesterday morning, "Global Times" reporter in the streets of Urumqi see louboutin pas cher many people in the early mor

betrayal I, negotiable price" big cards, standing in U hollister france rumqi Little Simon Successful square in fr ray ban ont of the underground passage. When reporters arrived, there are dozens of people watching. Man looks a little shy,hollister france, re hogan d with cold hands clutching a large solitaire sides. Near a hawker t

's tour air jordan pas cher ism charter, hogan air jordan pas cher, passenger class lines more than three and transportation of hazardous chemicals special vehicles,hogan, install air jordan and use satellite positioning device,air jordan, the implementation of information management. In 2011,abercrombie, road traffic accidents occurred

's position is communicated. In an interview before the court air jordan information desk,air jordan, Magnotta police custody in mulberry outlet Montreal police base in the north of the survey and interrogation. Police hope to expeditiously confirm Jiun skull's whereabouts. Currently,mulberry outlet, other parts hogan outlet of the remain

Xifei ho air jordan w the viru hollister france s is xifei it In fact, smoking costs the virus,air jordan, the main pr hollister inciple is through self-texting,hollister france, make voice calls chargeback, and automatically delete or block the charges related to carriers receipt messages,hollister, make phone calls, Wap Internet and oth

Carefully check the incineration plant various types of pipes, valves, equipm ray ban ent and other facilities,ray ban, and prevent pipe rupture valv hollister e damage caused by accidents.

Gas operator guidance to further implement gas safety gas users responsibility to increase public awareness of gas safety mulberry outlet ,

"Beijing Ditan Hospital,hogan, Beijing birthmark target hogan ing dissection" "First Di hollister france vision (International) Psoriasis Research Institute" "strong Speranskia film,hollister france," "God Que sugar Kang" "Drum Qing Chun bone cells to repair Essence" abercrombie pas cher "nine Parmesan Soup

,abercrombie pas cher, No. 71

's hear ray ban t at this hogan outlet time also anxiety, and even a sense of guilt, it is eager to ge louboutin t a positive response. Thus, the mother Liu Zou teacher recommendations, write an sincere letter to his daughter. Mother hold love letters, you better stop by Sharon count the line, trying to think of a whole day at home

's abercrombie pas cher table. Norma air jordan pas cher lly at this time, in a low price of cooking oil, but this year a greater fluctuation. "I have heard of edible oil to rise in price, just buy the drums stored at home mulberry outlet ." Grandpa Wang Jiangxi Ganzhou hurry before the price adjustment at the supermarket before the breath buy several vats

This blog was... how do I say it? Relevant!! Finally I've found
something which helped me. Thanks!

During the dialogue,abercrombie france, abercrombie france the two agreed that should continue to promote anti-terrorism,hoga hogan n, agreed will further strengthen exchanges and cooperation in the field of counter-terrorism.

He said that during the dialogue,ray ban, th ray ban e U.S. side has informed the killing "base" org

So put aside the things named.

barbour jacket

The most secret vote five times in three years selection of model workers in hollister france 1977-1979 nearly three-year period, a total of five awards ceremony was held, where in 1977 once,barbour jacket, tw barbour sale ice each in 1978 and 1979,hollister france, a total of five times in

's awareness of security compared with hogan Western countries is very wea parajumpers outlet k,hogan, therefore, suffer very serious network attacks.

In addition,parajumpers outlet, some operators actively carry out a false source address hollister uk remediation work,hollister uk, the common TCP SYN FLOOD, UDP FLOOD other false

. "â–  Focus 2 compulsory insurance to pay high insurance limits different needs hogan of urban and rural compulsory barbour sale insurance insurance rate though on the rise, but there are still many vehicles did not participate.

WASHINGTON (Reporter Yang Huayun) Ministry of Public Se barbour curity proposed to study in

"" Payment of Wages Ordinance,hollister uk, "the most important elem hollister uk ent is to ensure the parajumpers pas cher payment of wages of migrant workers,parajumpers pas cher, and from a higher level to resolve legal." Yang Zhiming told reporters that in rece mulberry outlet nt years the Ministry of Human Resources and Social Security on the ri

(hereinafter referred to as "Water Investment Group"), in the past year, the mulberry outlet Government's efforts rai hollister outlet sed more than 100 billion of net assets of state-owned investment group for water for injection.

MENG Hao told the "First Financial Daily" reporters, s barbour jacket aid the same in 2008 with the introducti

Second, we must unswervingl barbour sale y adhere to maintain social stability.

Comra hollister france de Mao Zedong, Deng Xiaoping and Jiang Zemin at the core of the party's three generations of central collective leadership of Xinjiang made a se abercrombie ries of major decisions work and work arrangements, indicating the correct di

Wu sa hogan outlet id China parajumpers and the DPRK are friendly neighbors.


This is the third time this year, the two meet, the first two were in abercrombie pas cher May and July.

Wu said the NPC of China and the DPRK Supreme People's Assembly in the political life of their respective countries have played an important ro

Dai Y hogan ixi abercrombie pas cher n believes that the current environment of increasing public attention, but barbour uk to promote the national environmental action requires turning force.

Recently, Zhang Lu Jinan citizens to local environmental protection departments to play a complaint call, reporting units near a constructi

An injured famil barbour uk y introduced yesterday morn hollister france ing injured workers were arranged to the hospital floor, each wounded by a government departme hollister outlet nt staff escort, the injured and the families of staff required by the government.


She and her family every day diet officers sent by the government,

If we say that police work is "people", Securit hollister france y Control System is the "skeleton", the basic level is the "flesh",hollister hollister uk france, the latter two combine to make police work can radiate powerful combat effectively prevent and punish crimes, deepen peace building.

In August, the Ministry of barbour jacket

" barbour outlet Currently, over 1,700 monas barbour sale teries in Tibet, more than 46,000 monks and nuns do not have a self-immolation." NPC deputy part barbour uk y secretary of Tibet Autonomous Region,barbour outlet, said Qiangba Puncog, Tibetan Buddhist temples on ten thousand, a number of Tibetan self-immolation, and repeatedly


Jins moncler outlet hazhou Bridge expansion project also forma mulberry outlet l foundation yesterday, is expected to be completed two years later.

Wanqingliang invited Ma Alibaba's SME loan will be settled in Guang barbour sale zhou project,moncler outlet.

Wanqingliang together, wishing Ma let into their position.


's speec

net profit of $ 3.63 billion,p parajumpers arajumpers, up 45% yoy.

P & G's old rival Unilever half mulberry outlet profit has continued to grow,mulberry outlet, its 2012 semi-annual report shows that the first half of Unilever's fo hogan outlet od,hogan outlet, personal care and home care are to achieve the three main areas of growth

Earlier,barbour outlet, the organizers held a press conference revealed that barbour outlet in addition to outside the 10 name Hangzhou Chenghuang Temple buil parajumpers ding will "hold together" the inscription,parajumpers, 10 participating cities will sign a "joint declaration of China's top ten famous building-material cu mulberry sale l

portable fire, fire into the mountain barbour uk s into the forest, proh barbour sale ibiting firewood for heating, outdoor smoking, throw fire, burning fire, burning ridge, burning garbage, straw, manure litter ash heap of weeds prohibited picnic, fire grill hogan outlet ed food, discharge

As at 18:00 on February 15, the city of

China's developmen abercrombie pas cher t has been and will continue to countries ar hollister uk ound the world including Japan brings important opportunities.

We are willing to Japan one, aimed at achieving pe mulberry outlet aceful coexistence, friendship for generations, mutually beneficial cooperation and common development goals, momentu

's national conditions,hollister, t hollister he reality of Tibet and the Tibetan peo abercrombie ple's fundamental interests.

Tibet work under the new situation, we must take Deng Xiaoping Theory and "Three Represents" as guidance, thoroug barbour outlet hly implement the scientific concept of development,abercrombie, correctly h

Second, to further improve the community medical staff recommende hollister uk d treatment.

- "Now the pens hogan ion agency lacks, high charges, nurses functions might also be standardized." Retired worker Lee Po reflection.


'm sorry, we take time to rest Sun parajumpers day Today I went to our community's purpose is

â–¡ special attention Mo Yan caut mulberry sale ious because of "must-depth research,mulberry sale," stern, Cher hollister outlet ishing such as gold, cautious - to attend two of the country's Mo Yan to reporters leave that impression.

3 members have yet parajumpers outlet to report,hollister outlet.

According to the hotel staff said, t

US-China Strategic and Economic Dialogue is an impor barbour sale tant mechanism for bilateral relations, effectively promote barbour jacket d the mutual understanding and cooperation.

The world needs China and the U.S. to establish better,barbour sale, more stable,barbour jacket, predictable relationship.

U barbour outlet .S. V

Christina parajumpers was barbour uk born in February 1953,parajumpers, she was the Argentine Congressman, Senator.

In addition,barbour uk, Christina hollister france will also visit Shanghai,hollister france, visit the Shanghai World Expo.

Christina will also visit China Foreign Economic and Trade University,barbour outle

According to Human Resources and Social Security Minister Yin Weimin introduced barbour t hogan outlet his year,barbour, human resources and social security departments at all levels to increase the protection of enterprises to pay wages and labor dispute mediation efforts to prevent and resolve wag parajumpers outlet e arrears for migrant

Bureau of Finance and so on.

Found wid hollister uk espr parajumpers outlet ead false statement or false invoices for services rendered list taking funds, reimbursement costs unrelated case.

Audit Direction: culture, educa moncler outlet tion typical case: Many high school debt, have lost their ability to repay last year,hollister u

do not know whether it will affect the safety hollister of the bridge, because of fear every time he walked hogan outlet in here to see the car deck after the adoption dare trot through.

Source: People - Hainan Windows Wang Chengxian

Every time I walk in th parajumpers pas cher e Sea Rd overpass bridge walkways are very worried,

Whe barbour uk n a reporter asked the Philippin moncler outlet e government would take the matter to the Chinese government put pressure on th mulberry sale e Chinese government to be responsible for this incident, the President Aquino merely said: "The owner was able to escape dry lines." Some analysts said that last year lasted two


If you have the end of the evaluation,hollister outlet, the Chinese h hollister outlet ow to draw conclusions

Tripartite summit age piumini moncler nda is currently working on issues such consultations.

The meeting will be held May 29 to 30, held in Jeju,piumini moncler, Korea.

See you next we barbour sale ek!


par

Currently parajumpers ,parajumpers, the Guangdong High Court has formulated and barbour uk issued a microblogging trial management practices, to further standardize the work of the province's Court of microblogging, microblogging to barbour sale promote the province's Court of group construction,barbour uk, and constantly improve and b

"Brand actually represents a culture,moncler outlet, moncler outlet the other hand many of our business, and now the main emphasis on econo barbour jacket mic efficiency, how to better pursue production to meet the national psyche, enabling consumers to trust and rely on a lot of products are still lacking." Should

"Can hollister n

fro barbour uk m 622 samples from Zhejiang Province were detected in two duck-posit parajumpers ive samples, Huzhou City, Zhejiang north from agricultural trading center; from from

The H7 hollister outlet H7 gene fragment and habitually has not changed much,barbour uk.

The virus itself may be genetic variants of avian influe

Wooden temple Chang also said that former Ambassador Niwa Ambassador parajumpers outlet during his tenure visited China 27 provinces and autonom hollister france ous regions,parajumpers outlet, and hands-on grassroots exchanges.

He also hoped that Chinese and Japanese nationals to have more extensive and in-depth e hogan xchanges,holl

No gu hollister uk est house, in principle determined by frugal designat hogan ed reception unit arrangement.

Housing specifications must be strictly from simple to arrange accommodation in abercrombie Lanzhou city survey no.

Provincial Committee and accompanying staff without affecting the operational needs of the

According to the Hainan Provincial Bureau of Statistics preliminary stat parajumpers outlet istics, real estate in parajumpers Hainan Province in 2012 the added value of 23.956 billion yuan, an increase of 5.9% over the previous year.

The media recently reported "Hainan housing stock of many developers selling cheap" situ mulberry outlet a

She said, do not write microblogging is becaus barbour uk e "not so much time,barbour uk barbour , if he discloses the name of microblogging users, but users do not have time to respond promptly, it may cause a bad influence, so barbour outlet select 'dive'." At the same time

At the time of the State Council, composed of 28 mi

China and Germany compared to standard, lead barbour jacket ,barbour jacket, chromium, nickel,barbour outlet, cad barbour outlet mium and other heavy metals migration limits consistent with China but also more heavy metals arsenic in foods.

Chinese Dietary Referenc hogan outlet e Intakes provides appropriate adult intake of manganese 3.

Su Hao into the vortex of public opinion and therefore, in November of parajumpers that year removed from the public security system. hollister france

Road Department, and are waiting here to take a taxi to Liu XX,parajumpers, five people and caused an altercation fight.

In the meantime, only the Shanxi Traffic mulberry sale

Traffic police also said that if barbour pas cher the snow has been down,b hogan outlet arbour pas cher, the traffic control measures may also be upgraded.

10 cases the amount of accidents,hogan outlet, causing no casualties.

In addition, from 16:0 mulberry outlet 0 to 19:30, Shanghai-Hangzhou-Ningbo, Hangzhou-Jinhua-Quzhou,mulber

Leave a comment


Movable Type Help?

"Can my Movable Type issue or project be taken care of by a professional?" Yes It Can Be! Contact YesItCan.be
Powered by Movable Type 5.2.7