Mathias Bynens 4/16/2010

Inline `<script>` and `<style>` vs. external `.js` and `.css` — what’s the size threshold?

Read Original

This technical article analyzes when to use inline <script> and <style> elements versus external .js and .css files. It discusses the performance trade-offs, focusing on the HTTP request overhead, caching limitations, and optimal file size thresholds (around 400-600 bytes) based on expert opinions. It covers considerations for mobile users, concatenation strategies, and practical implications for code like the Google Analytics snippet.

Inline `<script>` and `<style>` vs. external `.js` and `.css` — what’s the size threshold?

Comments

No comments yet

Be the first to share your thoughts!

Browser Extension

Get instant access to AllDevBlogs from your browser

Top of the Week