Application and Page Cache 404/500

I have a manifest that looks something like this:

CACHE MANIFEST # e4a75fb378cb627a0d51a80c1cc5684c2d918d93e267f5854a511aa3c8db5b1a /a/application.js /a/application.css NETWORK: * FALLBACK: / /offline/redirect 

The problem is that my pages /404.html and / 500.html (which are obviously served by 404 and 500 response codes) start a backup. They act as if the server was offline.

My question is twofold:

  • Why does /404.html start a backup when / events do not work?
  • How can I allow /404.html and / 500.html not to start backups when /

call him up.

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

 NETWORK: * /404.html /500.html 

... however, since these pages are served with a non-200 response code, it causes an application cache error callback and the cache is not saved.

Thanks!

+4
source share
1 answer

What worked for me:

  • Remove * from NETWORK ad
  • Redirect to /404.html (and others) instead of rendering.

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

0
source

Source: https://habr.com/ru/post/1395345/


All Articles