Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Tools for validating HTML 5 offline cache manifests?

Tags:

html

offline

HTML 5 includes the ability to specify how to run the web application offline. As I'm about to start authoring these things, I'm looking for a tool to validate the syntax of the offline cache manifest files. Ideally, I'd run it as part of the build process.

I'm aware HTML 5 is still in draft, but waiting isn't an option. I may write one, but I was hoping someone had knocked one out already.

like image 368
McDowell Avatar asked Jun 19 '26 22:06

McDowell


1 Answers

I use the simple bash script to generate cache.manifest each time I build my application:


#!/bin/bash

MANIFEST_FILE="cache.manifest"
echo "CACHE MANIFEST" > ${MANIFEST_FILE}
echo "#Created at `date -Ru`" >> ${MANIFEST_FILE}
echo "" >> ${MANIFEST_FILE}
echo "CACHE:" >> ${MANIFEST_FILE}
find . -type f | cut -c 2- | grep -v '^[[:space:]]*$' | grep -v '^/cache.manifest$' >> ${MANIFEST_FILE} 
echo "" >> ${MANIFEST_FILE}
echo "NETWORK:" >> ${MANIFEST_FILE}
echo "/api" >> ${MANIFEST_FILE}
like image 163
Miroff Avatar answered Jun 24 '26 14:06

Miroff



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!