Load cache manifest file - html

How to make server to return manifest file with text/cache-manifest content type? By default, if I put it to the server and include into <html manifest="cache.manifest"> it is being loaded with type application/x-ms-manifest.

That's one of the reasons why the recommended extension for manifest files is now .appcache - Microsoft is already using .manifest for something else. To configure content types:
In IIS6 and below, add the MIME type mappings on the header tab of your virtual directory or web site properties (MS instructions).
In IIS7 and later, either go to MIME types in Features view or add a mimeMap entry under staticContent in your web.config like <mimeMap fileExtension=".appcache" mimeType="text/cache-manifest" />

you may include
AddType text/cache-manifest .appcache
in your .htaccess
or if you happen to use PHP you can send header information
header('Content-Type: text/cache-manifest');

Was having trouble caching an offline site on the iPad through GoDaddy hosting... Their mime type is incorrect for Safari support, so I simply made an cache.ASPX page:
<%#Page ContentType="text/cache-manifest" ResponseEncoding ="utf-8" %>
At the bottom of the page... Hope this helps someone!

You have to have a helicon file type .htaccess for it to work with IIS. Is can have an .htaccess file, just needs to be a # Helicon ISAPI_Rewrite configuration file
Version 3.1.0.82

Related

How to render pages without .html extension as html pages in Apache server

I made a webpage that should load a html files into a iframe. When you click something, it appears in . Although all of my files are html documents with html tags, they don't have extensions. So in the iframe, it renders as plain text. How do i configure Apache server setting so that the default file extension is set to ".html" when the file doesn't have any extension? Does it have anything to do with .htaccess file?
It seems like I can hide file extensions by doing some trick in that file, but I'm trying to do the opposite (adding an extension). How do I do this?
If you are using an old version of Apache:
DefaultType text/html
DefaultType Directive
MIME content-type that will be sent if the server cannot determine a type in any other way
For the current version:
Use the mime.types configuration file and the AddType to configure media type assignments via file extensions, or the ForceType directive to configure the media type for specific resources. Otherwise, the server will send the response without a Content-Type header field and the recipient may attempt to guess the media type.
So:
# force all files to be text/html:
<Location />
ForceType text/html
</Location>

Issue in using application cache

Hi I'm trying to use application cache .As it is documented I'm getting a prompt like :
This website() is asking to store data on your computer for offline use .
with 3 options :
1.Allow 2. Never for this website 3. Not now
In my case only 3rd option works .Why?
Here is my html file
<html manifest="example.appcache">
.......
</html>
It's because you:
either are hosting the appcache file locally on your computer, and your computer does not return the correct MIME to your browser: text/cache-manifest
or your server (IIS/Apache) is not configured correctly to deliver the .appcaches files with the correct MIME.
For Apache you need to add this line to your .htaccess
AddType text/cache-manifest .appcache
For IIS, there are tutorials to be found if you search for "appcache IIS MIME"

Application Cache html5

I'm learning how application cache works, but I got a problem.
I created my manifest file and 'imported' it in my index.html.
In the offline.manifest file I added:
CACHE MANIFEST
34567.js
and in my index file:
<html manifest="offline.manifest">
I'm working on localhost, but when I tried to search the script, I get nothing.
I erased the cache too, but result is the same.
I read about creating an .htaccess file and I created it with this string:
AddType text/cache-manifest .manifest
But, where I'd put it?
Apache's .htaccess file, which configures the web server, can be placed anywhere in the directory tree so long as you write your directive paths correctly. Based on the syntax AddType text/cache-manifest .manifest you'd need to keep the .htaccess in the same directory as the .manifest file here.
See this very similar question via the StackExchange network.
If you are not serving the .manifest with the correct text/cache-manifest content type it will be ignored.

Apache not assigning correct MIME type for .manifest HTML5 offline file

I'm running XAMPP apache web server and developing an HTML5 project and the .manifest file is not being 'assigned' the correct MIME type by the web server.
If a user accesses my HTML5 web app and tries to use it offline it will fail because my web server is not assigning the correct MIME type for my app's .manifest file.
Here is my question: is there a configuration I need to set in my Apache web server so that the "text/cache-manifest" MIME type is assigned?
I have already tried this change in my .htaccess file found in the root of my web server, c:/xampp/htdocs/.htaccess -- this is the entire .htaccess file's contents in the root of my web server at c:/xampp/htdocs, and I added the last 2 lines here, and neither my .manifest file nor (if I change it) a file with the extension .appcache is going to be accessed by a visitor to my web app, because the MIME type is still not being assigned by my web server to the correct type of "text/cache-manifest":
AuthType Basic
AuthName "FORBIDDEN AREA"
AuthUserfile "../htdocs/forbidden/.htpasswd"
Require valid-user
AddType text/cache-manifest .manifest
AddType text/cache-manifest .appcache
Is there something else in my XAMPP web server I need to set so that the .manifest or .appcache file gets assigned the correct "text/cache-manifest" MIME type?
To serve appcache mime-type in Apache "and Xampp is apache inside", add this line to your config file: mime.types
text/cache-manifest appcache
into your file mime.types located
xampp\apache\conf\mime.types

HTML5: Why I need to add manifest file to .htaccess?

I have seen some articles about HTML5 Manifest, which say that we must add manifest file to .htaccess with following line:
AddType text/cache-manifest .manifest
However, there is no any explnation what is the purpose of adding?
Where should I place this .htaccess file ? in the same folder where the manifest file is? and finally how can i make sure that it is added to .htaccess successfully?
Even if i do not create any .htaccess file, i only add this to my html file
<html manifest="site.manifest">
I can see the popup bar in firefox, asking that the website is asking to store data. So isn't it working without this .htaccess?
I'll appriciate if anyone can explain. Thanks.
You don't "add a manifest file" to .htaccess with that line. That line just tells Apache that files with the suffix ".manifest" will be of type text/cache-manifest. Apache tells the client about the file type in the HTTP content-type header. The HTTP content-type header is required for the browser/client to understand how to interpret the contents of the file. Refer:
AddType Directive # httpd.apache.org
The cache manifest in HTML5 # en.wikipedia.org
The cache manifest syntax # w3.org
Offline Web Applications # w3.org