There's 2 ways to fix that.

Add the full external image path to your NETWORK: section that way it
will never be cached and when you're online it will grab it from the
server, when you're offline you'll get the blue question mark.

The other solution is adding the full path to your CACHE: section
which will cache it on the phone but if the image is changed it won't
be requested until a change happens to the manifest. The benefit is
that even if the user is offline the google image will show up.

So your manifest could look like this:

---------manifest file below----------
CACHE MANIFEST
# v1
# lines that begin with a pound sign are comments and are ignored

CACHE:
# this is the default, try the cache first for these items
index.html
blue-checkbox.gif

NETWORK:
# always fetch items listed here from the network, never the cache
http://www.google.se/intl/en_com/images/logo_plain.png
------------------------

or you can cache it.

---------manifest file below----------
CACHE MANIFEST
# v1
# lines that begin with a pound sign are comments and are ignored

CACHE:
# this is the default, try the cache first for these items
index.html
blue-checkbox.gif
http://www.google.se/intl/en_com/images/logo_plain.png

NETWORK:
# always fetch items listed here from the network, never the cache
------------------------

Hope that helps.

-Ryan

On Mar 12, 2:56 am, Eric Persson <[email protected]> wrote:
> I've stumbled upon a strange problem when using manifest for caching
> some files. If I have a cached html page that refers to a external
> image, it doesnt load. It doesnt even attempt to load.
>
> Is this expected behaviour or is there a way around it?
>
> Simple example demonstration the problem is available 
> at:http://eric.persson.tm/manifest_test/
>
> At the first load it loads, next reload it doesnt work, since then its
> the manifest at work.
>
> ----htmlfile below-----
> <!DOCTYPE html>
> <html lang="en" manifest="test.manifest">
> <head>
>      <title>Manifest test external images</title>
> </head>
> <body>
>
>      First a local image:<br />
>      <img src="blue-checkbox.gif" alt="This is a local image marked for
> caching in the .manifest." />
>      <br />
>      <br />
>
>      Then a external one:<br />
>      <img src="http://www.google.se/intl/en_com/images/logo_plain.png";
> alt="This is a external image" />
>
> </body>
> </html>
> ---------------------
>
> ---------manifest file below----------
> CACHE MANIFEST
> # v1
> # lines that begin with a pound sign are comments and are ignored
>
> CACHE:
> # this is the default, try the cache first for these items
> index.html
> blue-checkbox.gif
>
> NETWORK:
> # always fetch items listed here from the network, never the cache
> ------------------------
>
> Also have a .htaccess to get the correct mimetype on the test.manifest:
> <Files "test.manifest">
> ForceType 'text/cache-manifest'
> </Files>
>
> The local image blue-checkbox.gif is not included.
>
> Best regards,
>    Eric

-- 
You received this message because you are subscribed to the Google Groups 
"iPhoneWebDev" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/iphonewebdev?hl=en.

Reply via email to