cache.manifest & Yahoo webhosting?
January 19, 2010 2:31 PM   Subscribe

How do I serve a .manifest file as "type text/cache-manifest" using Yahoo small business webhosting? I have created the manifest file and uploaded it to the server. I have declared the manifest file in the index.html, but I don't think the mime-type is recognized. Yahoo doesn't allow ht access files to be uploaded either. (I am trying to write my first web-app for the iPhone) Thanks for any guidance!
posted by DB Cooper to Computers & Internet (4 answers total)
 
Best answer: I don't know what a cache-manifest is. But I'll take a shot.

The webserver is what sends the mime header. I assume if you can't upload .htaccess files you can't edit the settings of the webserver either. This means that you are 100% out of luck with this approach.

If you can specify any arbitrary kind of filename for your manifest though, you could try pointing your manifest declaration (?) to some kind of CGI program (perl, shell script, whatever). CGI output declares its own mime in the Content-type header. E.g.:

#!/usr/bin/perl
print "Content-type: text/cache-manifest\n\n"
print "Blah blah blah\n"
print "Line two of blah blah blah\n"

This is evil and hackish, but evil and hackish things must be done with evil and hackish file-upload and webserver control policies.
posted by jock@law at 3:26 PM on January 19, 2010


Best answer: The standard way to do this is with a .htaccess line saying AddType text/cache-manifest .manifest, but of course that's not an option for your hosting.

If Yahoo supports PHP, you can do something like jock@law's suggestion by creating a separate .php file like this:
<?php
header('Content-Type: text/cache-manifest');
readfile('whatever.manifest');
?>
That way you can leave the manifest file itself as plain text, but point your app to the PHP script which serves it with the appropriate MIME type. You may want to add additional headers so that the manifest file itself can be cached, if that's important for your use case.
posted by teraflop at 3:48 PM on January 19, 2010 [1 favorite]


Response by poster: Thank you both! Yahoo doesn't support what I wanted to do, but using your suggestions my browser asked if I would allow it to store the webpage offline as requested. So, I guess it worked!
posted by DB Cooper at 4:08 PM on January 19, 2010 [2 favorites]


I found this helpful since Yahoo doesn't support .htaccess modification but I can't seem to get it to work. I've set my manifest (brackets for chevrons) at the top of my index.html file as:

{!DOCTYPE HTML}
{html manifest="manifest.php"} {!--Normally this would be cache_manifest.cfm --}

The manifest.php file contains the following code:

{html}
{head}
{title}manifest{/title}
{/head}
{body}

{?php
header('Content-Type: text/cache-manifest');
readfile('cache_manifest.cfm');
?}

{/body}
{/html}

The cache_manifest.cfm file contains:

CACHE MANIFEST

# Cache Manifest Version: 1.8

# Core files.
homescreen.png
setup.js
startup.png
toolbar.png

The index.html file, manifest.php file, and cache_manifest.cfm are all in the root directory of my site. Any ideas what I am doing wrong?
posted by scrandall at 9:16 AM on July 15, 2010


« Older charges   |   One wedding dress, two sleeves, zero frump? Newer »
This thread is closed to new comments.