Using manifest property in html5 - html

From what I userstand,
<html manifest="test.appcache" xmlns="http://www.w3.org/1999/xhtml">
that is a sample on how one would use the manifest property.
CACHE MANIFEST
CACHE:
# Offline cache v2
# html files
index.html
# css files
styles.css
# js files
main.js
and the above is a sample of the manifest file.
However, when I try to run it from my iTouch, the cache is not working.
I just want to ask if the server affects if certain html5 property work? because the server I am using is quite old.
Thanks in advance

You have to make sure that the server delivers the manifest file with a MIME type of
text/cache-manifest
This could be done (assuming you're using apache) by adding
AddType text/cache-manifest .appcache
to your .htaccess file in the directory the manifest is residing in.

Related

Caching with manifest, html5

File manifest.php contains data
ACHE MANIFEST
index.html
page.html
category.html
If I change name of manifest.php to new_manifest.php, will it re-cache files or use the earlier cached data?
If you change the name of the manifest file so the old manifest is not found on server anymore then the cache will be dropped and all files will be loaded from server.
Depending on how the new files and manifest are then they will be re-cached.

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>

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.

Load cache manifest file

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

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