getsentry / self-hosted

Sentry, feature-complete and packaged up for low-volume deployments and proofs-of-concept
https://develop.sentry.dev/self-hosted/
Other
7.78k stars 1.76k forks source link

Use `min` prefix for minified file extensions #2962

Open stayallive opened 5 months ago

stayallive commented 5 months ago

Problem Statement

Currently Sentry serves it's minified CSS and JS files as follows:

_static/dist/sentry/entrypoints/sentry.css
_static/dist/sentry/entrypoints/app.js

(these are just an example, I'm guessing there are more)

This is not an issue for sentry.io but for self-hosted users that put their instance behind Cloudflare this can cause issues because Cloudflare will try to optimize those files a second time which can result in corrupted JS files and hard to track down issues.

Solution Brainstorm

Now the easiest solution is to document this somewhere and just tell users to disable auto optimizations performed by Cloudflare but I figured I give it a shot to see if this could be changed in general so this can't happen if you miss the documented warning.

Using .min.css and .min.js file extensions which Cloudflare (and other optimizing CDNs) will identify as already minified and skip processing further.

As per Cloudflare docs:

The feature will deliberately skip minification for JS and CSS files with .min in the name.

Latest Discord thread: here.

Product Area

Other

getsantry[bot] commented 5 months ago

Assigning to @getsentry/support for routing ⏲️

aldy505 commented 5 months ago

I'm glad that we found another thing that should be documented.

aldy505 commented 4 months ago

Yeah, it.. kinda fall short since Cloudflare's deprecating this https://community.cloudflare.com/t/deprecating-auto-minify/655677

But I don't know about other CDN like Fastly or anything other than Cloudflare