معرفی 5 کد طلایی برای افزایش سرعت سایت که فقط کافیست این کد ها را در فایل اچ تی اکسس | .Htaccess قرار دهید.
معرفی این کدها :HTTP Compression بهینه سازی کد های اچ تی تی پی
Page Caching بهینه سازی کدهای صفحه اصلی سایت
Image Caching بهینه سازی عکس ها
Javascript Caching بهینه سازی کدهای جاوا اسکریپت
CSS Caching بهینه سازی کد های سی اس اس
کد اچ تی اکسس | .Htaccess برای HTTP Compression بهینه سازی کد های اچ تی تی پی
<IfModule mod_deflate.c>
# Enable gzip encoding
AddOutputFilterByType DEFLATE text/plain text/html text/xml text/css text/javascript application/xml application/xhtml+xml application/rss+xml application/javascript application/x-javascript
</IfModule>
کد اچ تی اکسس | .Htaccess برای Page Caching بهینه سازی کدهای صفحه اصلی سایت
<IfModule mod_expires.c>
# Enable expirations
ExpiresActive On
# HTML
ExpiresByType text/html "access plus 2 days"
</IfModule>
کد اچ تی اکسس | .Htaccess برای Image Caching بهینه سازی عکس ها
<IfModule mod_expires.c>
# Enable expirations
ExpiresActive On
# My favicon
ExpiresByType image/x-icon "access plus 1 year"
# Images
ExpiresByType image/gif "access plus 1 month"
ExpiresByType image/png "access plus 1 month"
ExpiresByType image/jpg "access plus 1 month"
ExpiresByType image/jpeg "access plus 1 month"
</IfModule>
کد اچ تی اکسس | .Htaccess برای Javascript Caching بهینه سازی کدهای جاوا اسکریپت
<IfModule mod_expires.c>
# Enable expirations
ExpiresActive On
# Javascript
ExpiresByType application/javascript "access plus 1 month"
</IfModule>
کد اچ تی اکسس | .Htaccess برای CSS Caching بهینه سازی کد های سی اس اس
<IfModule mod_expires.c>
# Enable expirations
ExpiresActive On
# CSS
ExpiresByType text/css "access plus 1 month"
</IfModule>