1. Reference:The same CSS file (their ETags are equal), due to the difference in the response’s content-type, leads to the difference in the interface of the web page. Discover the response’s Content-Type based on MIME_CONTENT_TYPE – the MIME type of the detection file, and finally based on the MIME-TYPE detection LEAGUE/MIME-TYPE-detection League/mime-type-detection implementation. Detect according to content, and fall back to by Extension Detection. as shown in Figure 1

use League\MimeTypeDetection\ExtensionMimeTypeDetector;
$this->detector = new ExtensionMimeTypeDetector();
Log::info(
$return['asset_key'],
[
$return['asset_key'],
$this->detector->detectMimeTypeFromPath($fullPath),
]
);
[2023-05-18 14:00:04] local.INFO: apps/internal/code-display/blocks/code-display.blade.php [
"apps/internal/code-display/blocks/code-display.blade.php",
"application/x-httpd-php"
]
[2023-05-18 14:00:04] local.INFO: apps/internal/comment/.env.local [
"apps/internal/comment/.env.local",
null
]
[2023-05-18 14:00:04] local.INFO: apps/internal/comment/app.json [
"apps/internal/comment/app.json",
"application/json"
]
[2023-05-18 14:00:04] local.INFO: apps/internal/comment/assets/app.6e10b7.css [
"apps/internal/comment/assets/app.6e10b7.css",
"text/css"
]
[2023-05-18 14:00:04] local.INFO: apps/internal/comment/assets/app.f8ed5d.js [
"apps/internal/comment/assets/app.f8ed5d.js",
"application/javascript"
]
[2023-05-18 14:00:05] local.INFO: apps/internal/custom-button/assets/images/ali-express-large.8fdc24.png [
"apps/internal/custom-button/assets/images/ali-express-large.8fdc24.png",
"image/png"
]
[2023-05-18 14:00:07] local.INFO: apps/internal/sharing-incentives/assets/images/sparkles.a0d182.jpg [
"apps/internal/sharing-incentives/assets/images/sparkles.a0d182.jpg",
"image/jpeg"
]
2. Check the generated Content-Type, which is in line with expectations. NULL is returned when the corresponding extension does not exist. At this time, it needs to be retracted.
Log::info(
$return['asset_key'],
[
$return['asset_key'],
$this->detector->detectMimeTypeFromPath($fullPath) ?? mime_content_type($fullPath),
]
);
Need long-term technical maintenance or remote troubleshooting?
I am a PHP / Go backend engineer with 15+ years of experience, focused on existing system maintenance, bug fixing, performance optimization, server troubleshooting, WordPress maintenance, and small feature iterations.
If your project is facing any of the following issues, we can start with a small troubleshooting task first:
- ✅ PHP / Laravel / Yii2 legacy systems without active maintenance
- ✅ Go / Gin backend APIs that need troubleshooting or optimization
- ✅ Slow, broken, or unstable WordPress websites
- ✅ Nginx / MySQL / Redis / Linux server issues
- ✅ CDN / Cloudflare / DNS / HTTPS configuration problems
- ✅ Long-term remote technical support or part-time maintenance
More details: About Me & Collaboration
WeChat: 13980074657
Email: shuijingwanwq@gmail.com
Telegram: @shuijingwan
GitHub: https://github.com/shuijingwan

Leave a Reply