SSI pages can also contain flow control commands. These provide the ability to perform advanced alteration of a the html page.
The various flow control commands are as follows:
<!--
<!--
<!--
<!--
When one of the expressions matches, then the html enclosed in the matching block is parsed and returned to the client. Flow control commands can be nested.
| Expression |
Meaning |
| string |
False if string is non-empty, true otherwise |
| string1 = string2 |
True if the strings match |
| string1 != string2 |
True if the strings do not match |
| string1 > string2 |
True if the string1 is greater than string2(string compare) |
| string1 >= string2 |
True if the string1 is greater than or equal to string2(string compare) |
| string1 < string2 |
True if the string1 is less then string2(string compare) |
| string1 <= string2 |
True if the string1 is less than or equal to string2(string compare) |
| ! expression |
Inverts the result of an expression; true if expression is false |
| ( expression ) |
Groups an expression together; true if the expression is true |
| expression1 || expression2 |
True if either expression1 or expression2 is true |
| expression1 && expression2 |
True if both expression1 and expression2 are true |
- Inside strings, variables starting with a '$' are expanded. For example "$SERVER_PROTOCOL" will be expanded to HTTP/1.1
- For the '=' and '!=' comparisons, string2 will be interpreted as a regular expression if it starts and ends with a '/'.
- Strings can be quoted using single quotes. If they arn't quoted, any white space between adjacent strings are merged into a single space.
- Operators bind in the following order (tightest first): !, =, !=, ||, &&
Caching of expressions
In order to improve performance of expressions and regular expressions, Zeus Web Server caches the last 100 expressions it parsed, and the last 100 regular expressions. These values can be altered using the following tunables:
tuning!ssi!expressioncachesize 100
tuning!ssi!regexcachesize 100
Apache Compatibility
The Zeus implementation follows as closly as possible the documentation for Apache, however Apache has some bugs in its expression parsing (especially '$' expansion). By default Zeus parses the expressions without implementing the bugs. In order to switch the parser to the 'Apache bug Compatibility' mode, set the following tunable (in web/global.cfg):
tuning!ssi!apachebugcompat yes
Example
An example use of flow control commands would be to report back to the client the browser that is being used.
<!--
No user agent specified
<!--
Microsoft Internet Explorer
<!--
Mozilla or something that identifies itself as such (almost everything)
<!--
Other browser type
<!--