HTML and CSS Reference
In-Depth Information
How to serve the manifest
There's one last hurdle to jump before you can take your
application completely offline: You need to serve the manifest
fi fi le p r o p le r fi y , m le a n fi n g fi it m u s it h a v le it h le le x it le n s fi o n .manifest and
it must have the right mime-type.
If you're using a common web server like Apache, you need to
add the following to your mime.types fi le:
text/cache-manifest manifest
This ensures that Apache is sending the text/cache-manifest
fi fi le h le a d le r w h le n y o u r le q u le s t a n y fi fi le w fi t h t h le .manifest exten-
sion. You can test this by checking the headers of the fi le
requested using a tool like curl and the -I (capital i):
curl -I http://mysite.com/time.manifest
That should return (something like) this:
HTTP/1.1 200 OK
Date: Thu, 04 Mar 2010 12:59:30 GMT
Server: Apache/2.2.13 (Unix) mod_ssl/2.2.13 OpenSSL/0.9.8l
¬ DAV/2 PHP/5.3.0
Last-Modified: Mon, 01 Mar 2010 16:20:24 GMT
Accept-Ranges: bytes
Content-Length: 113
Content-Type: text/cache-manifest
Now that your serve is sending the right headers, and your
manifest fi le is ready to be used, pat yourself on the back. Let's
take a look at it in action.
NOTE Changing the mime
types on your web server
is beyond the scope of this
book, but get in touch with your
hosting company and they will
point you in the right direction.
The browser-server process
When working with the offline applications, it's useful to under-
stand the communication process between the browser and the
server. If at all possible, I recommend running the following com-
mand on your servers to tail your access logs whilst refreshing
your page using the cache manifest to see exactly what's being
pulled. It will show you whether the fi les from your manifest are
actually being requested and served up by your server:
tail -f logs/access_log
 
 
 
Search WWH ::




Custom Search