BryceWray
05/11/2023, 1:08 PM_middleware.js
stuff for the first time with CF Pages, in an attempt to use it instead of an existing CF Worker. The middleware works perfectly on the pages.dev
version — but, on the custom-domain version from that pages.dev
, only the HTML files are affected even though it’s for all routes and files. To be more specific: on the pages.dev
version, a number of custom headers (such as for caching) are added to a variety of file types, including CSS and image files; but, on the custom-domain version, this works for only the HTML files.
Is there something special I have to do in the domain’s DNS, or elsewhere, to make the middleware work properly on the custom domain, too? (And I did remove the custom domain’s routes from the Worker for the test, so the Worker shouldn’t have been interfering.)
The pages.dev
domain = static-site-2to.pages.dev
The custom domain = brycewray.com
**Note**: I have had to re-add the custom domain routes to the Worker and take the _middleware.js
file out of the project in order to regain the previous functionality, at least until I can learn why the middleware file doesn’t work on the custom domain. Let me know if you want me to restore the test setup.BryceWray
05/12/2023, 1:31 AMGreg Brimble | Cloudflare Pages
05/12/2023, 9:36 AMGreg Brimble | Cloudflare Pages
05/12/2023, 9:37 AMBryceWray
05/12/2023, 11:10 AMBryceWray
05/12/2023, 4:56 PMGreg Brimble | Cloudflare Pages
05/12/2023, 5:25 PMBryceWray
05/12/2023, 6:01 PM