AnderssonPeter/CompressedStaticFiles

*.br and *.gz Not Served

pm64 opened this issue · 1 comments

pm64 commented

In my project, I can see that alternative encodings for images are correctly served (for example, PNG is requested, WEBP is returned).

But this doesn't seem to be the case for static .js, .css, .svg files etc. compressed via Brotli and GZip, at least when compressed and named as in the example Gulpfile.

For example, I'm serving app.js, app.js.br, and app.js.gz. In browser dev tools, a request/response for app.js shows a blank Content-Encoding value, whereas I expect it to be "br" or "gz". Am I misunderstanding the process? Or perhaps there's an extra initialization step necessary to enable Brotli and GZip?

(Note: initially I didn't even deploy app.js, since GZip is universally supported, so I didn't think the plain app.js file would ever be necessary. But then I observed that requests for app.js resulted in a 404, whereas I expected CompressedStaticFiles to intervene and return either the gz or br encoding, both of which were available and supported by the client. Depending on the outcome of this issue, I might open a separate issue on the necessity of unencoded resources.)

pm64 commented

I found the issue, it was unrelated to this library. Let me know if you'd like details.