Am 04.12.12 23:55, schrieb Gustaf Neumann:
Am 04.12.12 20:06, schrieb Stephen Deasey:
- we should actually ship some code which searches for *.gz versions of static files
this would mean to keep a .gz version and a non-.gz version in the file system for the cases, where gzip is not an accepted encoding. Not sure, i would like to manage these files and to keep it in sync.... the fast-path cache could keep gzipped copies, invalidation is already there.

Dear all,

The updated version of naviserver supports now the
delivery of gzipped content via fastpath:

- added option "gzip_static" for "ns/fastpath" (default false)

Send the gzipped version of the file if available and the client
accepts gzipped content. When a file path/foo.ext is requested, and
there exists a file path/foo.ext.gz, and the timestamp of
the gzipped file is equal or newer than the source file, use the
gzipped file for delivery.

- added option "gzip_cmd" for "ns/fastpath" (default "")

Command for zipping files in case the (static) gzipped version of
the file is older than the source. The command is just used for
re-gzipping outdated files, it does not actively compress files,
which were previously not compressed (this would be wasteful for
e.g. large tmp files, there is not cleanup, etc.). If this parameter
is not defined, outdated gzipped files are ignored, and a warning is
written to the error.log. Example setting: "/usr/bin/gzip -9".

- added section for fastpath configuration to ns_return describing the
new and old configuration options (description of fastpath
parameters was completely missing)

When the gzip_cmd is configured, NaviServer keeps track of
updating the .gz file for the cases the source file is updated.
There is no burden for the admin. The gzip command is
called via Tcl "exec", which can in turn be executed via
nsproxy (see e.g. OpenACS). I took this approach
over an in-memory variant to avoid memory bloats in
case huge gzip files should be compressed. Note that
the compression overhead is typically just a one-time
operation. The website maintained defines, what
files should be sent gzipped by compressing these
once.

Gzipped content delivery happens now for
- ns_returnfile
- ns_respond -file
- static files from pagedir
when the corresponding .gz files are available.

all the best
-gustaf neumann

------------------------------------------------------------------------------
This SF.net email is sponsored by Windows:

Build for Windows Store.

http://p.sf.net/sfu/windows-dev2dev
_______________________________________________
naviserver-devel mailing list
naviserver-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/naviserver-devel

Reply via email to