3. Security
solutions requiring 100%
guarantee that the
content cannot be edited
from the Web
Reasoning Performance
The Problem dynamic Websites are
resource hungry
Quality Assurance
the ability to review
complete content and
functionality before every
deployment
4. Security
front-end/back-end
division
two-level authentication
Reasoning Performance
throwing hardware at the
Existing Approaches problem
caching
Quality Assurance
dedicated workflow
environments
test instances
6. Convert all Website
resources to static files
HTML
CSS
JS
The Solution attachments
Static Deployment media
Deploy the HTML on
a traditional Web server
✓ orders of magnitude
better performance
✓ incredibly simple
scalability
✓ server-agnostic quality
assurance
7. Examples:
HTTrack
wget
-‐-‐mirror
Static
Deployment ✓ out-of-the-box solution
with external tools ✗ weak control of output
✗ slow
8. Solutions for Plone:
enpraxis.staticsite
stxnext.staticdeployment
Static ✓ much faster than external
Deployment solutions
with internal tools ✓ fully configurable
✓ easy to customize
✗ needs integration with
website
9. Open-Source (ZPL)
two parts of configuration
Static basic: for content editors
advanced: for
Deployment administrators
stxnext.staticdeployment
incremental
content transformations
pluggable
integration with Xapian
12. User profiles
Commenting
Static User communication
Deployment Search
...too static!
We need something more
sophisticated!
13. Plone + Static
Deployment
The Solution Django for:
User profiles
Commenting
User communication
Xapian for search
Compiled Website
14. How to glue components
together?
The Solution
client-side approach:
JavaScript
✓ simple implementation
✗ many requests
✗ page flickering
server-side approach:
Apache SSI
✓ single request
✓ transparent to the user
Compiled Website ✗ skin customization
15. HTML preprocessor
provided by Apache httpd
at least since version 1.3
Processing controlled by
The Glue SGML comments
Basically enables:
Apache mod_include (SSI)
conditional text
inclusion of other files
inclusion of programs
printing/setting
environment variables
17. Enabling SSI in the server configuration:
Apache mod_include
...
LoadModule
include_module
modules/mod_include.so
...
AddType
text/html
.html
AddOutputFilter
INCLUDES
.html
...
Options
+Includes
Examples of basic directives:
current date on the server
<!-‐-‐#echo
var="DATE_LOCAL"
-‐-‐>
file modification date
Last
modified:
<!-‐-‐#flastmod
file="index.html"
-‐-‐>
inclusion of results from a dynamic application
<!-‐-‐#include
virtual="/app-‐comments/thread/3/"
-‐-‐>
executing local commands
<!-‐-‐#exec
cmd="uptime"
-‐-‐>
18. Inclusion of results from a dynamic application
<!-‐-‐#include
virtual="/app-‐comments/thread/3/"
-‐-‐>
Apache mod_include
How to specify an external application to be available
from /app-‐comments
?
RewriteEngine
on
RewriteRule
^/app-‐comments/(.*)$
http://localhost:8686/$1
[L,P]
What if the external application is not available?
Apache includes the following message by default:
[an
error
occurred
while
processing
this
directive]
This can be customized in server configuration by:
SSIErrorMsg
"<!-‐-‐
Error
-‐-‐>”
The default message can be overriden in HTML by:
<!-‐-‐#config
errmsg=”Custom
message"
-‐-‐>
19. context-specific arguments
need to be GET params
by default Django uses
URL parts
Gotchas redirect after POST
requests
Gluing Django with SSI POST requests cannot
render anything
form validation requires
additional plumbing
Website templating in two
places
Plone skin
Django templates
21. Apache is slow... NOT!
mpm_prefork
is evil
use mpm_worker
any experience with
mpm_event?
Gotchas Advantages of Apache:
Apache httpd largest install base
maturity measured in
years
the best WSGI module
available (mod_wsgi)
22.
python-‐xapian
binding
Ranked search
What about Suggests spelling
corrections
search? no Polish stemming
Xapian with SSI