knackforge
June 2, 2014
This blog gives you an understanding of cache manifest in Drupal. Cache manifest is used to cache pages in the local server to use it when there is no network connection. This can be easily done by adding attribute "manifest="filename.appcache" to the HTML tag as mentioned below:
<html manifest="example.appcache">
..
....
More details about cache manifest, in general, can be found here. Creating a manifest file and referring to that file in HTML tag is simple and straightforward in the normal HTML file. Now the question is, can this be done in Drupal? Yes, of course, this is possible.
Another question may arise, cache manifest is in HTML5, will it also work in the Drupal site which is not in HTML5.? Again yes to your question, it will work. Just adding manifest attribute to HTML tag is enough. Let us see this in detail below about how to cache manifest can be implemented in Drupal.
There are two ways to do this in Drupal, first by adding manifest value in html_attributes in hook_preprocess_html as mentioned below:
function ThemeName_preprocess_html(&$variables) {
$variables['html_attributes_array'] = array(
'manifest' => 'example.appcache',
);
}
Just like how your fellow techies do.
We'd love to talk about how we can work together
Take control of your AWS cloud costs that enables you to grow!