10

I have run into an issue with one of my webpages that was changed to use the HTML5 appcache feature. Safari is blocking my cross site css files when the appcache is enabled on a page. The page, http://www.ericperrets.info/, loads a number of image/css files from my server and a number of css files from a google url/servers. Below is the epi.appcache file content

CACHE MANIFEST
#v2

CACHE:
default.css
/images/bg.gif
/images/bg2.gif
/images/external.png
/images/logo.gif
/images/mail_48.png
/images/meme.jpg
/images/pdficon.gif
/images/telephone_32.png
/favicon.ico
/js/dojo/dojo/dojo.js

NETWORK:
Resume%20-%20Eric%20Perret.pdf
index.html

This works find when the page load in firefox, but when I try to load it in Safari, it blocks the calls to http://fonts.googleapis.com/css?family=Reenie+Beanie&v1 and http://fonts.googleapis.com/css?family=Candal&v1 are blocked with the message

The URL can’t be shown

Not sure why this is happening.

3
  • Both mentioned files have Cache-Control private, which means that it should only be cached in a users browser (as opposed to public proxies, etc). Could this have anything to do with your problem? Jun 21, 2011 at 13:24
  • @Jonas, Not sure why Google uses Cache-Controle: private for it's CSS files and 'Cache-Controle: public` for it's fonts, but this was not the issue with my site. It was more long the lines that I did not explicitly say that all other http content should come from the network.
    – Eric
    Jun 24, 2011 at 17:01
  • 2
    They use cache-controle private because the want to serve different browsers different css files. Proxies should use the cached file to send to other users, with possibly other browsers.
    – Gerben
    Jul 18, 2011 at 17:42

1 Answer 1

15
+50

Appcaches when defined are used by the browser to specify what files exist on your site that are relevant to the particular page the browser is visiting. Think of the appcache like a whitelist, it lists all the files that can be accessed and how they should be accessed.

Therefore when Safari, which in my experience is following the AppCache standard a little more strictly than Firefox sees a request for a web address that is not in the AppCache, it does not allow access.

To get around this you can either add the resources either to your cache section or to the network section. The better option in my mind is to use a wildcard "*" path in the network section to ensure that requests are not blocked.

NETWORK:
*
http://*
https://*
1
  • This worked perfectly for me. What I ended up using is... CACHE MANIFEST #v3 CACHE: /default.css /images/bg.gif /images/bg2.gif /images/external.png /images/logo.gif /images/mail_48.png /images/meme.jpg /images/pdficon.gif /images/telephone_32.png /favicon.ico /js/dojo/dojo/dojo.js NETWORK: /Resume%20-%20Eric%20Perret.pdf /index.html * http://* https://*
    – Eric
    Jun 24, 2011 at 16:47

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.