با مجموعهها، منظم بمانید
ذخیره و طبقهبندی محتوا براساس اولویتهای شما.
این قوانین زمانی فعال می شود که PageSpeed Insights تشخیص دهد که اندازه یکی از منابع شما می تواند از طریق کوچک سازی کاهش یابد.
بررسی اجمالی
کوچکسازی به فرآیند حذف دادههای غیرضروری یا اضافی بدون تأثیر بر نحوه پردازش منبع توسط مرورگر اشاره دارد - به عنوان مثال نظرات و قالببندی کد، حذف کدهای استفاده نشده، استفاده از نامهای متغیر و تابع کوتاهتر و غیره.
برای کوچک کردن جاوا اسکریپت،UglifyJS را امتحان کنید. Closure Compiler نیز بسیار موثر است. میتوانید یک فرآیند ساخت ایجاد کنید که از این ابزارها برای کوچک کردن و تغییر نام فایلهای توسعه و ذخیره آنها در دایرکتوری تولید استفاده کند.
از طرف دیگر، ماژول PageSpeed با یک وب سرور Apache یا Nginx ادغام می شود تا به طور خودکار سایت شما را بهینه کند، از جمله کوچک سازی منابع.
تاریخ آخرین بهروزرسانی 2025-07-25 بهوقت ساعت هماهنگ جهانی.
[null,null,["تاریخ آخرین بهروزرسانی 2025-07-25 بهوقت ساعت هماهنگ جهانی."],[[["\u003cp\u003eThis documentation is outdated and refers to a deprecated version of PageSpeed Insights API (v4) which will be shut down.\u003c/p\u003e\n"],["\u003cp\u003eMinification is the process of removing unnecessary data from web resources (HTML, CSS, JavaScript) without impacting functionality, improving page load speed.\u003c/p\u003e\n"],["\u003cp\u003eYou can use tools like HTMLMinifier, CSSNano, csso, UglifyJS, and Closure Compiler to minify your resources.\u003c/p\u003e\n"],["\u003cp\u003eThe PageSpeed Module for Apache or Nginx servers can automatically optimize your site, including minification.\u003c/p\u003e\n"]]],["Minification reduces resource size by removing unnecessary data without affecting browser processing. Key actions include minifying HTML, CSS, and JavaScript. Use tools like HTMLMinifier for HTML, CSSNano or csso for CSS, and UglifyJS or Closure Compiler for JavaScript. A build process can automate minification, or the PageSpeed Module can optimize sites on Apache/Nginx servers. The content refers to PageSpeed Insights for identifying areas for minification.\n"],null,["# Minify Resources (HTML, CSS, and JavaScript)\n\n| **Deprecated** . This page was written for version 4 of the PageSpeed Insights API, which is deprecated and will be shut down in May 2019. [Version 5](/speed/docs/insights/v5/get-started) is the latest and provides both real-world data from the Chrome User Experience Report and lab data from Lighthouse.\n\nThis rules triggers when PageSpeed Insights detects that the size of one of your resources could\nbe reduced through minification.\n\n### Overview\n\nMinification refers to the process of removing unnecessary or redundant data without affecting how\nthe resource is processed by the browser - e.g. code comments and formatting, removing unused code,\nusing shorter variable and function names, and so on.\n\nSee [preprocessing \\& context-specific optimizations](/web/fundamentals/performance/optimizing-content-efficiency/optimize-encoding-and-transfer#minification-preprocessing--context-specific-optimizations) to learn more.\n\n### Recommendations\n\nYou should minify your HTML, CSS, and JavaScript resources:\n\n- **To minify HTML,** try [HTMLMinifier](https://github.com/kangax/html-minifier)\n- **To minify CSS,** try [CSSNano](https://github.com/ben-eb/cssnano) and [csso](https://github.com/css/csso).\n- **To minify JavaScript,** try [UglifyJS](https://github.com/mishoo/UglifyJS2). The [Closure Compiler](/closure/compiler) is also [very effective](https://github.com/samccone/The-cost-of-transpiling-es2015-in-2016#summary-of-findings). You can create a build process that uses these tools to minify and rename the development files and save them to a production directory.\n\nAlternatively, the [PageSpeed Module](/speed/pagespeed/module),\nintegrates with an Apache or Nginx web server to automatically optimize your site, including resource minification.\n\nFeedback\n--------\n\nWas this page helpful? \nYes Great! Thank you for the feedback. If you have a specific, answerable question about using PageSpeed Insights, ask the question in English on [Stack\n| Overflow](https://stackoverflow.com/questions/tagged/pagespeed-insights). For general questions, feedback, and discussion, start a thread in the [mailing list](https://groups.google.com/forum/#!forum/pagespeed-insights-discuss).\nNo Sorry to hear that. If you have a specific, answerable question about using PageSpeed Insights, ask the question in English on [Stack\n| Overflow](https://stackoverflow.com/questions/tagged/pagespeed-insights). For general questions, feedback, and discussion, start a thread in the [mailing list](https://groups.google.com/forum/#!forum/pagespeed-insights-discuss)."]]