From: Rich Bowen Date: Thu, 5 Nov 2009 02:42:38 +0000 (+0000) Subject: Moves the "dynamically regenerated" rule to advanced. X-Git-Tag: 2.3.3~35 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=8adffe51d9cc53fe02a83a8603901b8b1ab4aca5;p=apache Moves the "dynamically regenerated" rule to advanced. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@832977 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/docs/manual/rewrite/advanced.html.en b/docs/manual/rewrite/advanced.html.en index 0ca151d715..133e8667d8 100644 --- a/docs/manual/rewrite/advanced.html.en +++ b/docs/manual/rewrite/advanced.html.en @@ -32,7 +32,9 @@ them, rather than merely cutting and pasting the examples into your configuration. -

See also

+

See also

top

URL-based sharding accross multiple backends

@@ -90,6 +92,47 @@ RewriteRule ^/u/([^/]+)/?(.*) http://${users-to-hos +
top
+
+

On-the-fly Content-Regeneration

+ + + +
+
Description:
+ +
+

We wish to dynamically generate content, but store it + statically once it is generated. This rule will check for the + existence of the static file, and if it's not there, generate + it. The static files can be removed periodically, if desired (say, + via cron) and will be regenerated on demand.

+
+ +
Solution:
+ +
+ This is done via the following ruleset: + +
+# This example is valid in per-directory context only
+RewriteCond %{REQUEST_FILENAME}   !-s
+RewriteRule ^page\.html$          page.cgi   [T=application/x-httpd-cgi,L]
+
+ +

Here a request for page.html leads to an + internal run of a corresponding page.cgi if + page.html is missing or has filesize + null. The trick here is that page.cgi is a + CGI script which (additionally to its STDOUT) + writes its output to the file page.html. + Once it has completed, the server sends out + page.html. When the webmaster wants to force + a refresh of the contents, he just removes + page.html (typically from cron).

+
+
+

Available Languages:  en 

diff --git a/docs/manual/rewrite/advanced.xml b/docs/manual/rewrite/advanced.xml index 21675a0816..c828673036 100644 --- a/docs/manual/rewrite/advanced.xml +++ b/docs/manual/rewrite/advanced.xml @@ -97,4 +97,45 @@ RewriteRule ^/u/([^/]+)/?(.*) http://${users-to-hos +
+ + On-the-fly Content-Regeneration + +
+
Description:
+ +
+

We wish to dynamically generate content, but store it + statically once it is generated. This rule will check for the + existence of the static file, and if it's not there, generate + it. The static files can be removed periodically, if desired (say, + via cron) and will be regenerated on demand.

+
+ +
Solution:
+ +
+ This is done via the following ruleset: + +
+# This example is valid in per-directory context only
+RewriteCond %{REQUEST_FILENAME}   !-s
+RewriteRule ^page\.html$          page.cgi   [T=application/x-httpd-cgi,L]
+
+ +

Here a request for page.html leads to an + internal run of a corresponding page.cgi if + page.html is missing or has filesize + null. The trick here is that page.cgi is a + CGI script which (additionally to its STDOUT) + writes its output to the file page.html. + Once it has completed, the server sends out + page.html. When the webmaster wants to force + a refresh of the contents, he just removes + page.html (typically from cron).

+
+
+ +
+ diff --git a/docs/manual/rewrite/rewrite_guide.html.en b/docs/manual/rewrite/rewrite_guide.html.en index 4a573c790c..4e99250f6d 100644 --- a/docs/manual/rewrite/rewrite_guide.html.en +++ b/docs/manual/rewrite/rewrite_guide.html.en @@ -55,7 +55,6 @@
  • Retrieve Missing Data from Intranet
  • Load Balancing
  • New MIME-type, New Service
  • -
  • On-the-fly Content-Regeneration
  • Document With Autorefresh
  • Mass Virtual Hosting
  • Proxy Deny
  • @@ -801,50 +800,6 @@ HREF="*"
    top
    -

    On-the-fly Content-Regeneration

    - - - -
    -
    Description:
    - -
    -

    Here comes a really esoteric feature: Dynamically - generated but statically served pages, i.e., pages should be - delivered as pure static pages (read from the filesystem - and just passed through), but they have to be generated - dynamically by the web server if missing. This way you can - have CGI-generated pages which are statically served unless an - admin (or a cron job) removes the static contents. Then the - contents gets refreshed.

    -
    - -
    Solution:
    - -
    - This is done via the following ruleset: - -
    -# This example is valid in per-directory context only
    -RewriteCond %{REQUEST_FILENAME}   !-s
    -RewriteRule ^page\.html$          page.cgi   [T=application/x-httpd-cgi,L]
    -
    - -

    Here a request for page.html leads to an - internal run of a corresponding page.cgi if - page.html is missing or has filesize - null. The trick here is that page.cgi is a - CGI script which (additionally to its STDOUT) - writes its output to the file page.html. - Once it has completed, the server sends out - page.html. When the webmaster wants to force - a refresh of the contents, he just removes - page.html (typically from cron).

    -
    -
    - -
    top
    -

    Document With Autorefresh

    diff --git a/docs/manual/rewrite/rewrite_guide.xml b/docs/manual/rewrite/rewrite_guide.xml index 2986f87f5f..df2e137ece 100644 --- a/docs/manual/rewrite/rewrite_guide.xml +++ b/docs/manual/rewrite/rewrite_guide.xml @@ -796,50 +796,6 @@ HREF="*" -
    - - On-the-fly Content-Regeneration - -
    -
    Description:
    - -
    -

    Here comes a really esoteric feature: Dynamically - generated but statically served pages, i.e., pages should be - delivered as pure static pages (read from the filesystem - and just passed through), but they have to be generated - dynamically by the web server if missing. This way you can - have CGI-generated pages which are statically served unless an - admin (or a cron job) removes the static contents. Then the - contents gets refreshed.

    -
    - -
    Solution:
    - -
    - This is done via the following ruleset: - -
    -# This example is valid in per-directory context only
    -RewriteCond %{REQUEST_FILENAME}   !-s
    -RewriteRule ^page\.html$          page.cgi   [T=application/x-httpd-cgi,L]
    -
    - -

    Here a request for page.html leads to an - internal run of a corresponding page.cgi if - page.html is missing or has filesize - null. The trick here is that page.cgi is a - CGI script which (additionally to its STDOUT) - writes its output to the file page.html. - Once it has completed, the server sends out - page.html. When the webmaster wants to force - a refresh of the contents, he just removes - page.html (typically from cron).

    -
    -
    - -
    -
    Document With Autorefresh