Cache Manifest not working in Android Browser - android-browser

Cache Manifest doesn't work in Android Browser. It works fine in Chrome on Android, Safari on iOS and all main desktop browsers (Not IE).
My index.html starts like this:
<!DOCTYPE HTML>
<html manifest="cache.manifest" lang="en-GB">
<head>
My cache.manifest starts like this:
CACHE MANIFEST
# v1.0.1 - 2013-10-23
# Cache manifest created by Jez D
CACHE:
index.html
styles.css
scripts.js
As stated, this works fine on all relevant browsers except Android Native browser.
I have looked here, here and here but to no avail.
Android version is 4.2.2
What can I do to correct this?

The answer you're looking for is in the following article. At least, it did it for me.
http://www.html5rocks.com/en/tutorials/appcache/beginner/
Assuming you're using Apache as your web server, you need to make it serve your .manifest file in the correct content-type by adding the following line to your httpd.conf file.
AddType text/cache-manifest .manifest
By doing this and restarting my Apache server, it fixed the problem under Android's native browser. (v4.1.2) As you mentionned, other browsers were working fine without this line in my config file.
Hope this helps!

Related

PWA is still using old index.html file in Safari IOS

The problem was due to white screen of death after deploying PWA (This is really hard to reproduce but it is an ongoing issue for my clients). It seems to be the problem with cache. It is causing Uncaught SyntaxError: Unexpected token '<'. I know many thread talked about this but it doesn't seem to directly let me tackle and reproduce the issue.
The closest to be able to reproduce is by doing this.
Add PWA to home screen
Open PWA
Edit index.html to have .js file pointing to wrong hash in /var/www/my-server
When I reopen the PWA it is still serving the old index.html file.
Clearing Safari cache in my iPhone does nothing. PWA still serving old index.html file.
How can I debug what causing the phone to be using the old index.html file even when server already change the index.html file content?
I am using cloudflare
I am not configuring any Service Worker

Angular 2 cli deployment to Github Pages not working.. js file not found

I am unable to deploy my angular 2 app with angular cli:
angular-cli: 1.0.0-beta.14
node: 6.4.0
os: darwin x64
The deployed site logs error messages telling that the inline.js, main...bundle.js, styles...bundle.js, favicon.ico Failed to load with status 404.
Everything works fine locally but problem starts when in production deploying to Github pages.
The base href is also properly set. May be a problem in CSP???
Kindly guide(Already lost 2 days) Error Screenshot
Actually I sorted out it just now!
I see that when site is deployed using the ng github-pages:deploy, the site that is generated will have site url like:
xyz.github.io/ng-app
and also the base url will be set like ng-app. Thing I did was set a variable baseUrl: "/ngApp" and set the base url to <base href="{{baseURL}}"> and everything is working now. I guessed that it picked up the app name specified in the angular-cli.json and so it did not match the repo name in github etc... thanks #shusson anyway

Add fonts for offline usage in angular?

Angular loads some fonts when starting.
https://fonts.googleapis.com/css?family=Source+Sans+Pro:300,400,700
When I start nodewebkit and I'm offline, it seems that try to load the fonts slows down the app...can I hold this font offline without loading?
Or angular alwasy watch online for this fonts?
Thanks!
This is not angular's concern. In HTML5 You can use an appcache for that.
as noted in http://www.w3schools.com/
HTML5 introduces application cache, which means that a web application
is cached, and accessible without an internet connection.
create a file beside your index.html named resource.appcache
add the link to the following files you want to cache inside resource.appcache
CACHE MANIFEST
# v1.0.0
https://fonts.googleapis.com/css?family=Source+Sans+Pro:300,400,700
then in your html, link it like
<!DOCTYPE HTML>
<html manifest="resource.appcache">
...
</html>

Application angular does not work in subfolder

My application works fine when I was running fine in local iis express. The application was running in the root url like 'http://localhost:61975/login'.
But in the web server the application was deployed in a folder and now I got the error 404 for all pages, scripts and content, because the app is ignoring the folder.
For instance:
Should be: http:\www.mydomain\folder\app\controller\mycontroller.js
as is: http:\www.mydomain\app\controller\mycontroller.js ERROR 404.
I already try to put the tag , but does not work too.
Any help, please?
Tks
If you are using html5mode: $locationProvider.html5Mode(true) you should be setting the HTML base tag:
<base href="/" target="_blank">
in your HTML header. This is a common reason why some scripts and assets are ignored.
Also refer to this question and see if it helps

AppCache stucks on android native browser

I run into a strange issue with my mobile site on which i'm trying to implement the appcache functionality. It works fine on desktop (Chrome & Firefox), on chrome for android and on iOS. But the android native browser (Android 4.3 running on a Samsung Galaxy S3) is driving me crazy.
The appcache is working fine, as long as i'm waiting till the browser downloaded all files who are defined in the manifest file. But if i click on a link, while the browser's still downloading, the download process stops and can't be "reactivated". Even when i refresh the browser or update the manifest file, nothing happens. To start over, i need to clear browser cache, close the tab, close the browser app and restart it again.
For debugging on the mobile device, i'm using this script: http://jonathanstark.com/blog/debugging-html-5-offline-application-cache and check the log in the debug mode. This is the status i got, as soon the download process crashes: "online: yes, event: downloading, status: downloading"
I'm serving the manisfest.appcache file as a cache-manifest and set the cache-control header in .htaccess like this:
AddType text/cache-manifest .appcache
<Files *.appcache>
ExpiresActive On
ExpiresDefault "access"
Header set Cache-Control "max-age: 0"
</Files>
And this is how the content of my manifest.appcache file looks like
CACHE MANIFEST
/some/nice/urls
/another/url
/even/more/urls
NETWORK:
*
http://*
In total, the user needs to download around 10MB.
Did someone run into the same or a similar issue with the android native browser?
Thanks for any advices!
Cheers

Resources