Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2005-11-09 16:35:25

oldi
Member
Registered: 2005-10-14
Posts: 87

Best practice for using forms

While playing a bit with different templates have noticed that some people use a simple structure of the default pages, by using

<code><txp:output_form form=“whatever” /></code>

and then they include all their headers, footer, etc in different forms. While others don’t have so many forms but simply incorporate most of their codes in the default page.

Although i like the first approach, i was wondering whether it makes any difference in terms of speed and performance. I guess, in the first case TXp will have to access more tables from the database in order to display one page, while in the second case the number of tables is smaller.

I am aware that for websites with very few hits this will not make any difference, but what about those sites that get lots of hits per day?

Any comments?

Thanks

Offline

#2 2005-11-09 17:00:05

Sencer
Archived Developer
From: cgn, de
Registered: 2004-03-23
Posts: 1,803
Website

Re: Best practice for using forms

<txp:output_form form="whatever" />

This will fetch the form form the db, making a single query. It is unlikely that a single (very simple) query has any noticable real-world effect on performance, even on high-traffic sites. If you are on mysql4 that query is a perfect candidate for query-caching, for example, because it is a simple fetch on a table that seldomly changes.

Though on higher traffic sites, you shouldn’t go overboard in using such form-calls.

Offline

Board footer

Powered by FluxBB