[phpa] Re: Cached "static" PHP vs HTML
- From: Manuel Lemos <mlemos@xxxxxxx>
- To: phpa@xxxxxxxxxxxxx
- Date: Thu, 18 Apr 2002 05:27:03 -0300
Hello,
Mark Rogers wrote:
>
> > [Snip loads of useful info]
>
> I'm glad I asked now; there's lots of useful info come out of it.
>
> As far as generating static HTML from PHP is concerned, what method do you
> use? Presumably you don't do it manually.
>
> Sorry, this has drifted a bit OT now.
I used what I called the "Page fault" method.
I have a sub-domain called en.static.phpclasses.org . en stands for
English, so there may be support for static versions of the site in
other languages.
The document tree of this sub-domain is initially empty. I set an error
handler document to a script that handles missing document errors.
Since the pages do not exist in this domain initially, the script is
called. It figures the URL that is requested and see if it matches a
valid pattern of documents and other files that should be rendered as
static files. If it matches, it makes a request to the main site for the
respective document using an HTTP class that I wrote a long time ago.
Then it stores the retreived document in a file of the static domain
tree, eventually creating any needed sub directories.
All non logged users are redirected to this domain, or mirror sites now.
It takes only one request per page to make it available, so the next
requests are served as static files.
Regards,
Manuel Lemos
------------------------------------------------------------------------
www.php-accelerator.co.uk Home of the free PHP Accelerator
To post, send email to phpa@xxxxxxxxxxxxx
To unsubscribe, email phpa-request@xxxxxxxxxxxxx with subject unsubscribe
- References:
- [phpa] Cached "static" PHP vs HTML
- From: Mark Rogers
- [phpa] Re: Cached "static" PHP vs HTML
- From: Manuel Lemos
- [phpa] Re: Cached "static" PHP vs HTML
- From: Mark Rogers
Other related posts:
- » [phpa] Cached "static" PHP vs HTML
- » [phpa] Re: Cached 'static' PHP vs HTML
- » [phpa] Re: Cached 'static' PHP vs HTML
- » [phpa] Re: Cached 'static' PHP vs HTML
- » [phpa] Re: Cached "static" PHP vs HTML
- » [phpa] Re: Cached "static" PHP vs HTML
- » [phpa] Re: Cached "static" PHP vs HTML
- » [phpa] Re: Cached "static" PHP vs HTML
- » [phpa] Re: Cached "static" PHP vs HTML
- » [phpa] Re: Cached 'static' PHP vs HTML
- » [phpa] Re: Cached 'static' PHP vs HTML
- » [phpa] Re: Cached 'static' PHP vs HTML
- » [phpa] Re: Cached 'static' PHP vs HTML
- » [phpa] Re: Cached 'static' PHP vs HTML
- [phpa] Cached "static" PHP vs HTML
- From: Mark Rogers
- [phpa] Re: Cached "static" PHP vs HTML
- From: Manuel Lemos
- [phpa] Re: Cached "static" PHP vs HTML
- From: Mark Rogers