ارور Leverage browser caching در وبسایت gtmetrix.com
سلام و درود دوستان .
وقت بخیر .
در وبسایت gtmetrix.com که میخواهیم سایتمان را انالیز کنیم اروری در مورد Leverage browser caching نمایش داده میشود .
ما کد زیر را در فایل .htaccess قرار دادیم اما وقتی باز هم انالیز میکنیم باز هم به همان مورد ایراد میگرد :
کد HTML:
## EXPIRES CACHING ##
ExpiresActive On
ExpiresByType favicon.ico "access plus 1 year"
ExpiresByType wp-content/fonts/font-bmi/font-bmi.woff "access plus 1 year"
ExpiresByType wp-content/fonts/yekan-joom/yekan-joom.woff "access plus 1 year"
ExpiresByType wp-content/themes/kallyas-PURCHASHED-4.15/template_helpers/icons/glyphicons_halflingsregular/glyphicons_halflingsregular.woff2 "access plus 1 year"
ExpiresByType wp-content/themes/kallyas-PURCHASHED-4.15/template_helpers/icons/kl-social-icons/kl-social-icons.woff "access plus 1 month"
ExpiresByType wp-content/uploads/zn_fonts/icomoon/icomoon.woff "access plus 1 month"
ExpiresDefault "access plus 2 days"
## EXPIRES CACHING ##
کد ما جایش مشکل دارد ؟
ممنون میشم دوستان راهنمائی کنند .
پاسخ : ارور Leverage browser caching در وبسایت gtmetrix.com
از دوستان کسی نیست راهنمائی کند ؟
پاسخ : ارور Leverage browser caching در وبسایت gtmetrix.com
اگه اشتباه نکنم شما باید بصورت Mime type ست کنید.
wp-content/fonts/font-bmi/font-bmi.woff به این صورت که آدرس فونت رو دادید بعید میدونم اعمال بشه :d
مورد بعدی هم اینکه شما تگ ماژول مود اکسپایر رو نذاشتید
<IfModule mod_expires.c>
</IfModule>
بصورت زیر تنظیم کنید ببینید درست میشه یا نه
کد:
<IfModule mod_expires.c>
ExpiresActive On
ExpiresByType image/jpg "access plus 1 year"
ExpiresByType image/jpeg "access plus 1 year"
ExpiresByType image/gif "access plus 1 year"
ExpiresByType image/png "access plus 1 year"
ExpiresByType text/css "access plus 1 month"
ExpiresByType application/pdf "access plus 1 month"
ExpiresByType text/x-javascript "access plus 1 month"
ExpiresByType application/x-shockwave-flash "access plus 1 month"
ExpiresByType image/x-icon "access plus 1 year"
ExpiresDefault "access plus 2 days"
</IfModule>
پاسخ : ارور Leverage browser caching در وبسایت gtmetrix.com
نقل قول:
نوشته اصلی توسط
1eng.ir
اگه اشتباه نکنم شما باید بصورت Mime type ست کنید.
wp-content/fonts/font-bmi/font-bmi.woff به این صورت که آدرس فونت رو دادید بعید میدونم اعمال بشه :d
مورد بعدی هم اینکه شما تگ ماژول مود اکسپایر رو نذاشتید
<IfModule mod_expires.c>
</IfModule>
بصورت زیر تنظیم کنید ببینید درست میشه یا نه
کد:
<IfModule mod_expires.c>
ExpiresActive On
ExpiresByType image/jpg "access plus 1 year"
ExpiresByType image/jpeg "access plus 1 year"
ExpiresByType image/gif "access plus 1 year"
ExpiresByType image/png "access plus 1 year"
ExpiresByType text/css "access plus 1 month"
ExpiresByType application/pdf "access plus 1 month"
ExpiresByType text/x-javascript "access plus 1 month"
ExpiresByType application/x-shockwave-flash "access plus 1 month"
ExpiresByType image/x-icon "access plus 1 year"
ExpiresDefault "access plus 2 days"
</IfModule>
ممنون دوست عزیز . اما این کد اماده توی اینترنت هست .
اما توی انالیز به سایت ما برای فونت ها ایراد گرفته است .
برای این موضوع باید چیکار کنیم ؟
م
پاسخ : ارور Leverage browser caching در وبسایت gtmetrix.com
کد:
ExpiresByType application/x-font-woff "access plus 1 year"
باید Mime type فونتها رو پیدا کنید و بذارید توی htaccess
اگه این کد کار نکرد بصورت font/woff و font/woff2 بذارید.
پاسخ : ارور Leverage browser caching در وبسایت gtmetrix.com
نقل قول:
نوشته اصلی توسط
1eng.ir
کد:
ExpiresByType application/x-font-woff "access plus 1 year"
باید Mime type فونتها رو پیدا کنید و بذارید توی htaccess
اگه این کد کار نکرد بصورت font/woff و font/woff2 بذارید.
ممنون .
فقط لطف میکنی کد کاملش را برام بفرستی ؟ قبل و بعدش چی باید باشد ؟
پاسخ : ارور Leverage browser caching در وبسایت gtmetrix.com
کد:
<IfModule mod_expires.c>
ExpiresActive On
ExpiresByType image/jpg "access plus 1 year"
ExpiresByType image/jpeg "access plus 1 year"
ExpiresByType image/gif "access plus 1 year"
ExpiresByType image/png "access plus 1 year"
ExpiresByType text/css "access plus 1 month"
ExpiresByType application/pdf "access plus 1 month"
ExpiresByType text/x-javascript "access plus 1 month"
ExpiresByType application/x-shockwave-flash "access plus 1 month"
ExpiresByType image/x-icon "access plus 1 year"
ExpiresByType application/x-font-woff "access plus 1 year"
ExpiresDefault "access plus 2 days"
</IfModule>
اینو بزن
سوال: وب سرورت چیه؟
پاسخ : ارور Leverage browser caching در وبسایت gtmetrix.com
سلام و درود .
ممنون .
الان به این موارد ایراد میگیرد :
- connect.facebook.net/en_US/sdk.js (20 minutes)
- com/favicon.ico (2 days)
- wp-content/themes/kallyas-PURCHASHED-4.15/template_helpers/icons/glyphicons_halflingsregular/glyphicons_halflingsregular.woff2 (2 days)
نکته جالب اینجاست که اصلا فایل فایوایکون به ادرس وجود ندارد در سرور ما :
sitename.com/favicon.ico
پاسخ : ارور Leverage browser caching در وبسایت gtmetrix.com
لینک gtmetrix رو بده ببینم چشه
پاسخ : ارور Leverage browser caching در وبسایت gtmetrix.com
نقل قول:
نوشته اصلی توسط
1eng.ir
لینک gtmetrix رو بده ببینم چشه
ممنون .
لطف میکنید ادرس تلگرام تان را بفرمائید تا اونجا صحبت کنیم ؟