Okay, I’ve taken another look at the page you linked to.
On Sep 23, 2008, at 7:24 AM, Ulf Wigren wrote:
Thanks Walter,
I am quite familiar with iFrames and use them frequently, but some
say they are slow and not modern.
iframes are a way to show another page within the context of a
“container” page. That’s all they are. They are somewhere between
modern and old-school. They are definitely not valid XHTML Strict,
but you can use them in any Transitional doctype. They are no faster
or slower than the content they load. And it’s important to note that
the contents of an iframe will never be indexed as a part of your
page by a search engine. It will be indexed, but as a separate page,
and will not count toward the content of your site.
This page http://www.helinet.se/home/index.php?page_id=2 seems to
load another page within the index page, does it not? and very fast
too.
This site appears to be using a content management system. There’s no
telling which one, it might be a home-grown system – that would seem
to fit in with the rest of the site. What this system is loading is
one of a number of page fragments. While an iframe can load an
entire page, you cannot load an entire page as partial content within
another page. This would end up with an invalid and likely un-
viewable page. So while a regular page would have the full stack:
HTML
HEAD
/HEAD
BODY
DIV
/DIV
/BODY
/HTML
…a fragment might only be a single DIV.
DIV
some variable content here
/DIV
This particular page seems to be loading the variable content
fragment into a DIV named ‘content’. This DIV has its overflow set to
“auto”, which causes it to get scroll bars (like an iframe) whenever
the content overflows the dimensions of the DIV.
Is it only PHP that makes it fast? What I want to accomplish is
same function without iframes as with them and getting all the
scores on Google search engine as if there where many single pages.
What makes this fast is the fact that instead of loading a single
page then calling from it to other pages on other servers, this site
is taking a request from the browser that includes a querystring
variable, using the value of that variable to decide which content
snippet to pull from a database or a text file, assembling the entire
thing on the server, and sending it down the wire as a single page.
PHP is used to do this, but there are lots of other programming
languages, and they would be equally speedy and certainly would out-
shine an iframe-based solution, particularly if the content resided
on more than one server. As I noted above, the contents of iframes
are indexed as separate pages, and if they are a part of a separate
site, they do not get counted as part of your site.
There is a technique known as screen-scraping which allows you to
gather content from someone else’s site, strip it down to just the
part you want to show, and then cache that locally on your server so
you don’t have to go through all that more than once a day or so.
Various screen-scraping code examples exist in almost any server-side
language, you can find more at HotScripts and other similar code
repository sites. But I don’t think (from this example, anyway) that
you are trying to do this.
I know that this is achieved with the site above.
If you are trying to manage a site by breaking the content area from
a surrounding template, then again, I recommend you look at how
Master Pages work in Freeway. Because none of this server-side stuff
will be even remotely as fast as serving a single page from static
HTML. Apache (the Web server) is simply too well tuned and optimized
for any dynamic server-side concoction to compete.
If you are looking to gather content from another site (one which you
do not control) then look to see if that site includes an RSS feed.
Reading and re-presenting an RSS feed is not only more likely to be
legal than scraping HTML from that site, it also is a really well-
solved problem, due to the fact that RSS is a stricter (and simpler)
document type than HTML.
Walter
freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options