Common template for HTML page? - Page 2

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View

Re: Common template for HTML page?

On Thu, 08 Sep 2005 18:20:01 -0700, Dan wrote:

Quoted text here. Click to load it

Why is that better than the meta tag?  Isn't an .htaccess file a last
resort in a situation because it increases work for the server?

Re: Common template for HTML page?

WD10 wrote:
Quoted text here. Click to load it

A meta "http-equiv" tag is intended as a substitute for a real HTTP
header, for cases where for whatever reason you are unable to send one.
 It's more logically pure to send the right HTTP header in the first
place than to substitute for it later.


Re: Common template for HTML page?

On Sun, 11 Sep 2005, Dan wrote:

Quoted text here. Click to load it

Talk about this contributor missing the point!  OK, from the point of view
of a *server administrator*, the use of a .htaccess file (although
convenient) might be seen as a "last resort" compared to the use of the
server configuration, considering the extra bit of work done by the

On the other hand, for those who handle only a portion of a server
hierarchy, it would not be wise to give them unrestricted access to the
server configuration, whereas it's rather harmless to allow them to create
.htaccess files.

Furthermore, .htaccess files take immediate effect, whereas changes to the
configuration need a server reload (which you're hardly going to grant to
someone who only handles a portion of the server hierarchy, what?).

None of this has any relevance to sticking meta http-equiv into HTML
files, though.  And how do you suppose you're going to influence the HTTP
server configuration for non-HTML files (images, plain text, whatever).

Quoted text here. Click to load it


Originally the idea was that the server might pick these up from the
source and use them for constructing real HTTP headers; however, that
seems to have been rapidly dropped, probably for the reason I just
mentioned - it's useless for non-HTML files, and, once you've developed
something for non-HTML files, then you might as well use the same thing
for HTML too.

Later, client agents got the idea of evaluating these http-equivs for
themself.  But there are significant numbers of things that you simply
cannot do via http-equivs - those need real HTTP headers.

Quoted text here. Click to load it


The one exception I found was that MSIE (when I tried it) did not really
implement the HTTP "refresh" header - it only implemented the "meta
http-equiv".  But this header isn't in the HTTP specification anyway -
it's rather amusing, in a way, that it was introduced as a meta HTTP
equivalent to an HTTP header that didn't exist.  Oh well, that's another
topic, I suppose, really.

Re: Common template for HTML page?

Noozer wrote:

Quoted text here. Click to load it

My general technique is that each page looks like this:

    $title="My page";
    include "inc_top.php";
<!-- page content goes here -->
    include "inc_foot.php";

The "inc_top.php" file opens a PHP session (if I'm using them), checks
authorisation details associated with the session and page, does the HTTP
header stuff, links to style sheets and scripts, writes a <title> element
based on the $title variable, opens database connections, writes out the
<h1> heading based on $title, perhaps writes out a navigation menu and
then starts <div id="content">.

"inc_foot.php" closes <div id="content">, writes out any bottom navigation
and copyright statements, closes the database connection.

Toby A Inkster BSc (Hons) ARCS
Contact Me  ~

Re: Common template for HTML page?

On Mon, 5 Sep 2005, Toby Inkster wrote:

Quoted text here. Click to load it

Have you thought about cacheability? ...

Quoted text here. Click to load it

... then perhaps you have.  Could you be a bit more explicit about the
HTTP bit, please?

As you might gather, cacheability is one of my pet topics, and I'm
concerned that all too many pages on the web appear to be dynamic (due to
the use of SSI, ASP, PHP or whatever) when in fact their components hardly
change from one month to the next.  The result can be sluggish browser
response, with or without an intermediate web cache.

For anyone who cares to take an interest in this topic, I'd recommend my
favourite tutorial - admittedly it concentrates on shared web cache
servers, but the ideas that it promotes are good for browser cacheing too.  
Mark Nottingham, /

(And don't miss his cacheability engine - it showed up some significant
mistakes on our own official site, I can tell you.)

all the best

p.s as an alternative to these server-time dynamics, there's something to
be said for building static pages, as part of one's procedure for
publishing content to the web server.  The "make" command - normally
regarded as a programming tool - can handle this kind of job too: via the
Makefile it gets told which web pages depend on which components, and then
when anything changes, a "make" command re-publishes all the pages which
depend on changed components.  The server will then be in a position,
thanks to the static pages, to serve out proper cacheability indicators
such as ETag, size, and genuine last-changed date/time.

Re: Common template for HTML page?

Alan J. Flavell wrote:
Quoted text here. Click to load it

I think about it a lot, yes. But just because I *think* about it... ;-)

The biggest of the sites I maintain using this technique is far too
dynamic to even consider caching. Each page is customised for each
specific user; content is updated continuously; and there are a lot of web
applications that check on session data. I need to positively discourage
caching in this case.

It ain't too slow though, because I keep the HTML as lightweight as
possible; almost all the pages are under 5KB in size; other page elements
including CSS and images are cacheable.

Many of the other pages are simple static sites that have been built with
PHP purely for convenience. With these I generally develop them in PHP on
a testing server, but using ".html" file names; then I do a site crawl
with "wget" to create a static mirror of the site; I upload that,
and end up with a static site that is eminently cacheable.

Toby A Inkster BSc (Hons) ARCS
Contact Me  ~

Site Timeline