Quick and dirty HTML5 offline cache generator

abril 13th, 2012 § 0 comments § permalink

#!/bin/bash

echo "CACHE MANIFEST"
echo "#Generated: $(date)"
echo "CACHE:"
echo "/"
find . -type f |
while read i; do
if [ "${i:2}" != "$(basename $0)" ]; then
if [[ $i == \./* ]]; then
echo "${i:2}"
else
echo $i
fi
fi
done
echo "NETWORK:"
echo "*"

 

Remind the following:

  • Read a trustable source of information: html5rocks
  • Follow tips from appcachefacts.info
  • When serving your cache manifest file (could be any name, but the extension .appcache is recommended) use the content type:  text/cache-manifest

Where Am I?

You are currently browsing entries tagged with html5 at arde en el infierno.