#565·serve

Pages with .html respond with 301 Moved Permanently causing service workers to fail.

Author: bjdashCreated Oct 31, 2019Updated Dec 4, 2025

If a page is requested that has .html at the end then the response is a 301 Moved Permanently. And if this is stored in cache with the help of a service worker then reading it from cache on subsequent fetch event with cache.match() doesnt work as Chrome throws following error The FetchEvent for "http://localhost:5000/modules/tester.html" resulted in a network error response: a redirected response was used for a request whose redirect mode is not "follow".