Langsung ke konten
Skillpedia
Deploy & cloud (DevOps)75k · #2938

mime-type

Fungsinya

Skill ini memeriksa header tipe konten yang dikirim server untuk HTML, CSS, JavaScript, gambar, dan font. Skill ini cocok untuk orang yang mengelola server web atau mendiagnosis resource halaman yang rusak.

Kapan dipakai

  • ✓Saat Anda meminta agent memeriksa apakah server Anda mengirim tipe file yang benar.
  • ✓Saat stylesheet atau script tidak termuat dan Anda curiga tipe kontennya salah.
  • ✓Saat Anda menyiapkan hosting atau framework baru dan ingin memastikan header-nya benar.

Link skill

https://github.com/thedaviddias/Front-End-Checklist/blob/main/skills/mime-type/SKILL.md

Salin lalu tempelkan ke AI Anda (Claude, ChatGPT, atau Cursor) dan minta AI mengikuti instruksinya.

Cara pakai

Cara paling mudah: salin pesan ini dan tempelkan ke AI Anda. AI akan membaca skill dan mengikuti instruksinya.

Pesan siap tempel

Gunakan skill ini untuk membantu saya: https://github.com/thedaviddias/Front-End-Checklist/blob/main/skills/mime-type/SKILL.md Baca file SKILL.md di link tersebut dan ikuti instruksinya untuk tugas saya.
Mau AI Anda menemukan skill seperti ini sendiri?Pasang MCP Skillpedia gratis: cukup satu baris, dan AI mencari di antara 15.000+ skill sebelum tiap tugas.Pasang dalam 1 menit →

Contoh permintaan ke AI

“CSS saya tidak termuat di situs. Bisakah Anda memeriksa apakah server mengirim tipe konten yang benar?”

5 skill baru setiap minggu. 1 menit baca.

Cara kerjanya

Agent memeriksa header respons untuk halaman utama dan file yang tertaut. Agent membandingkannya dengan tipe yang diharapkan, seperti text/css untuk stylesheet, dan menyarankan perubahan server jika tidak sesuai.

Konten teknis (SKILL.md asli)

Teks asli dari pembuat, dalam bahasa Inggris, langsung dari GitHub.

MIME Type Validation

Incorrect MIME types cause browsers to block stylesheets and scripts (MIME sniffing is disabled by X-Content-Type-Options: nosniff), breaking page rendering and signalling poor site quality to crawlers.

Quick Reference

  • The Content-Type header must match the actual file type being served
  • HTML pages must be served as text/html; charset=utf-8
  • CSS files must be served as text/css and JavaScript as text/javascript
  • Incorrect MIME types cause browsers to block or mishandle resources

Check

For key pages and their linked resources, inspect the HTTP Content-Type response header. Verify HTML responses use text/html; charset=utf-8, CSS uses text/css, JS uses text/javascript, and images use image/jpeg, image/png, etc.

Fix

Update your server configuration to serve each file type with its correct MIME type. Set X-Content-Type-Options: nosniff to prevent browsers from guessing content types. In Next.js and similar frameworks, configure headers in next.config.js.

Explain

The Content-Type header tells browsers and crawlers what kind of content is being sent. When it mismatches the actual file type, browsers either block the resource or render it incorrectly—CSS served as text/plain won't be applied, and JavaScript served as text/html may be blocked by strict MIME checking.

Code Review

For HTML, CSS, and JS assets, check the Content-Type response header. Verify HTML responses include 'charset=utf-8'. Check that X-Content-Type-Options: nosniff is set. Flag any resource returning Content-Type: text/html that is not an HTML page. Check for missing charset declarations on text responses.


For full implementation details, code examples, and framework-specific guidance, see references/rule.md.

Rule page: https://frontendchecklist.io/rules/seo/mime-type

Pertanyaan umum

Apa yang terjadi jika tipe konten salah?

Browser dapat memblokir file atau menampilkannya dengan keliru, sehingga stylesheet mungkin tidak diterapkan sama sekali.

Apa fungsi nosniff?

Header X-Content-Type-Options memberi tahu browser agar tidak menebak tipe file, sehingga mereka mengandalkan nilai yang dikirim server.

Bagaimana cara mengatur ini di Next.js?

Skill menyarankan konfigurasi header di file next.config.js.

Detail

Deskripsi asli dari pembuat

Use when auditing server configuration or diagnosing broken resources. Applies to any web server serving HTML, CSS, JS, images, fonts, or other static assets.

repo: thedaviddias/Front-End-Checklist

Popularitas

Bintang GitHub
75k
Peringkat
#2938
Lisensi
MIT
Diperbarui
31/10/2026

Apakah skill ini berguna?

0

Masuk untuk memberi suara.

Komentar

  • …

Skill lain dari repositori ini

Skill serupa