4

I have a manifest that looks somethin like this:

CACHE MANIFEST
# e4a75fb378cb627a0d51a80c1cc5684c2d918d93e267f5854a511aa3c8db5b1a
/a/application.js
/a/application.css

NETWORK:
*

FALLBACK:
/ /offline/redirect

The issue is that my /404.html and /500.html pages (that are obviously served up with a response code of 404 and 500) are triggering the fallback. They both act just as if the server is offline.

My question is twofold:

  1. Why does /404.html trigger the fallback when /events doesn't?
  2. How can I allow /404.html and /500.html to not trigger the fallback while still allowing / to

trigger it.

For what it's worth, I've already tried this:

NETWORK:
*
/404.html
/500.html

... however since those pages are served w/ a non-200 response code, it triggers the app cache error callback and the cache isn't saved.

Thanks!

pnuts
  • 58,317
  • 11
  • 87
  • 139
jsharpe
  • 2,546
  • 3
  • 26
  • 42
  • FWIW, it's not just 404 and 500 pages, it's ANY route/method/action/whatever that returns a 400+ response code. So, something like /teams/1241231 where that 'team' doesn't exist, should render a 404 pages w/ a 404 code - but it's picked up by the FALLBACK. – jsharpe Feb 08 '12 at 05:09
  • Hi. Have you finally managed to get a solution for this? I'm having the same issue: obtaining fallback page as response when I should receive a 403. Suggested workaround of 'always return 200' is not a solution for me. – user683887 Jun 04 '12 at 11:13

1 Answers1

0

What worked for me:

  • Remove * from the NETWORK declaration
  • Redirect to /404.html (et al) instead of rendering in place.

So using the example above: /teams/1241231 302 redirect to /404.html which returns a 404 status code.

AMIC MING
  • 6,306
  • 6
  • 46
  • 62
rjspotter
  • 89
  • 1
  • 8