{"data":{"slug":"github-thedaviddias-front-end-checklist-skills-mime-type-71b22e097b77","title":"Validate MIME Types for Correct Resource Serving","summary":"Verify that web servers serve static assets with the correct MIME types to prevent browser blocking and improve SEO. The deliverable is a report identifying incorrect MIME types and recommendations for fixing them.","url":"https:\/\/skillshunter.net\/skills\/github-thedaviddias-front-end-checklist-skills-mime-type-71b22e097b77","json_url":"https:\/\/skillshunter.net\/api\/public\/v1\/skills\/github-thedaviddias-front-end-checklist-skills-mime-type-71b22e097b77","markdown_url":"https:\/\/skillshunter.net\/skills\/github-thedaviddias-front-end-checklist-skills-mime-type-71b22e097b77.md","download_url":"https:\/\/skillshunter.net\/skills\/github-thedaviddias-front-end-checklist-skills-mime-type-71b22e097b77\/download","category":{"slug":"software-development","name":"Software & Development"},"editor_note":"Ensure the server configuration is validated before running the check. For frameworks like Next.js, configure headers in next.config.js. Set X-Content-Type-Options: nosniff to prevent MIME sniffing.","instructions":"---\nname: mime-type\ndescription: \"Use when auditing server configuration or diagnosing broken resources. Applies to any web server serving HTML, CSS, JS, images, fonts, or other static assets.\"\nmetadata:\n  category: seo\n  priority: medium\n  difficulty: intermediate\n  estimatedTime: \"15\"\n  source: frontendchecklist.io\n  url: https:\/\/frontendchecklist.io\/rules\/seo\/mime-type\n---\n\n# MIME Type Validation\n\nIncorrect 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.\n\n## Quick Reference\n\n- The Content-Type header must match the actual file type being served\n- HTML pages must be served as text\/html; charset=utf-8\n- CSS files must be served as text\/css and JavaScript as text\/javascript\n- Incorrect MIME types cause browsers to block or mishandle resources\n\n## Check\n\nFor 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.\n\n## Fix\n\nUpdate 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.\n\n## Explain\n\nThe 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\u2014CSS served as text\/plain won't be applied, and JavaScript served as text\/html may be blocked by strict MIME checking.\n\n## Code Review\n\nFor 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.\n\n---\n\nFor full implementation details, code examples, and framework-specific guidance,\nsee `references\/rule.md`.\n\nRule page: https:\/\/frontendchecklist.io\/rules\/seo\/mime-type\n","use_cases":["Auditing server configuration for MIME type correctness","Diagnosing broken resources due to incorrect MIME types","Improving SEO by ensuring proper content-type headers"],"limitations":[],"compatibility":[],"setup_tip":null,"sample_input":null,"sample_output":null,"source_url":"https:\/\/github.com\/thedaviddias\/Front-End-Checklist\/blob\/e8d14d049010e2ce25afcd5e8609dfcbbe63e47e\/skills\/mime-type\/SKILL.md","source_commit":"e8d14d049010e2ce25afcd5e8609dfcbbe63e47e","license":null,"version":null,"listing_approved_at":"2026-11-23","created_at":"2026-11-22T17:04:36.000000Z","updated_at":"2026-11-23T04:55:39.000000Z","seo_title":"Validate MIME Types for Correct Resource Serving","seo_description":"Ensure correct MIME types are used for static assets to prevent browser blocking and improve SEO performance.","seo_keywords":["MIME type validation","Correct content-type headers","SEO best practices","Server configuration audit","Browser compatibility check"]}}