Am 16.01.17 um 10:17 schrieb John from Decent Espresso:
Thanks Gustaf (Hahaha) that is the cause of the mime-type problem. I’ve upgraded to ns 4.99.15 and the MIME type bug is now gone.

However, I’m still not having gzipped files automatically made. I’ve "chmod 777 ." and also "chmod 666 *.css" to try to find the root.
It appears that ns_gzipfile is not being called at all, as I modded it with this:

proc ns_gzipfile {source target} {
    puts "ns_gzipfile $source $target"

and it’s not ever called.

How would you recommend debugging this problem?

Is there some other nsd.tcl parameter needed indicate that (say) .js and .css files should be gzipped, but .jpg and .gif should not?
As David mentioned, one has to make a initial pick which files should be delivered via static gzip by gzipping these. As you mentioned, the the rules, what exactly should be delivered via gzip and what not might be complex, so, we do not want to add overhead at the first place.

Ages ago, i wrote the little script below as a kick-starter for gzipping for some filename patterns in some directories.
Maybe, someone will find this useful.

-g

###############################################################
#!/bin/bash
#
# This script checks a list of directories for a list of extensions and
# generated gzipped versions of the files that are found
#
# If the modification date of a file is newer than its gzipped version
# then the gzip file is regenerated
# Specify filetypes like *.css or a filename like index.html
FILETYPES="*.css *.js *.html"
# Specify a list of directories to check recursively
DIRECTORIES="/var/www/openacs.org/"

for currentdir in $DIRECTORIES
do
   for extension in $FILETYPES
   do
      find $currentdir -iname $extension -exec bash -c 
'PLAINFILE={};GZIPPEDFILE={}.gz; \
         if [ -e $GZIPPEDFILE ]; \
         then   if [ `stat --printf=%Y $PLAINFILE` -gt `stat --printf=%Y 
$GZIPPEDFILE` ]; \
                then    echo "$GZIPPEDFILE outdated, regenerating"; \
                        gzip -9 -f -c $PLAINFILE > $GZIPPEDFILE; \
                        chown nsadmin:nsadmin $GZIPPEDFILE; \
                 fi; \
         else echo "$GZIPPEDFILE is missing, creating it"; \
              gzip -9 -c $PLAINFILE > $GZIPPEDFILE; \
              chown nsadmin:nsadmin $GZIPPEDFILE; \
         fi' \;
   done
done

------------------------------------------------------------------------------
Developer Access Program for Intel Xeon Phi Processors
Access to Intel Xeon Phi processor-based developer platforms.
With one year of Intel Parallel Studio XE.
Training and support from Colfax.
Order your platform today. http://sdm.link/xeonphi
_______________________________________________
naviserver-devel mailing list
naviserver-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/naviserver-devel

Reply via email to