Index  Up  <<  >>  


My server is getting loaded. How do I use the static page capability?

Here is an example based on the simple demo.

To set up the simple demo catalog statically, all that is required is to put in catalog.cfg:

    StaticDir   /ext/htdocs/simple/static
    StaticPath  /simple/static
    StaticAll   Yes
    StaticFly   Yes
    NoCache     ord special

The root WWW directory (DocumentRoot) on my system is /ext/htdocs -- you would change your StaticDir accordingly. Make sure the directory is empty -- MiniVend will overwrite files there!

Then edit a couple of the pages -- catalog.html and results.html. They have ``dynamic'' elements, ones that prevent the static build for those two pages (and any searches calling them for a template) from succeeding. Insert anywhere in the page:

        [tag flag build][/tag]

This tells the builder to go ahead and build the static page anyway, despite the dynamic elements. (The elements in this case are the Perl code telling the user their name in catalog.html, the dynamic ``Check Basket'' icon on the results page, and some sorting parameters that are not used in the one-click search.)

At that point, if you are in control of the MiniVend software directory and changed directory to it, you should be able to run:

        bin/minivend -build simple

(Users who are provided a catalog without control of the server will not be able to do this. The administrator would need to get involved.)

You will see some output from the build command, giving you the status of the build for individual pages. (HINT: send the standard output to a file to get a full report.) It will show information like:

    Checking page catalog ......................................done.
    Checking page browse .......................................done.
    Checking page canceled ...............skipping, dynamic elements.
    ...
    Checking part number 00-0011................................done.
    ...
    Checking part number 00-342.................................done.
    Building page browse........................................done.
    ...
    Building page catalog ......................................
    >> found search mp=0/se=Renaissance.........................save.
    >> found search mp=0/se=Impressionists......................save.
    >> found search mp=0/se=Surrealists.........................save.
    >> found search mp=0/se=Americana...........................save.
    >> found search mp=0/se=Contemporary........................save.
    done.
    Building part number 00-0011................................done.
    ...
    Building part number 00-342.................................done.
    Re-checking /simple/static/scan5.html.......................none.
    ...
    Re-checking /simple/static/scan3.html.......................none.
    done.

Restart the server and re-enter the catalog. Now all accesses should be fast whenever possible. One-click searches and flypages are in static HTML space, and only orders and checkout ops should be parsed by MiniVend.

This should get you started -- see the documentation for more information, particularly the section on what are ``dynamic'' tags and how to flag databases as dynamic with the DynamicData directive.

Index  Up  <<  >>