منزل » أصحاب المواقع » تصميم » تحسين سرعة موقعك
formats

تحسين سرعة موقعك

نشرت يوم 26 سبتمبر, 2009 من قبل في تصميم

وفيما يلي قائمة من الأشياء التي يمكنك القيام به للمساعدة في تحسين سرعة تحميل الموقع.

  • استخدام ضغط GZIP CSS, جافا سكريبت وغيرها. فحص موقعك هنا.
  • تقليل جافا سكريبت الخاص. يمكنك استخدام JMin لهذا.
  • إزالة ETags
  • تعيين رأس انتهاء مدة الصلاحية لمستقبل
  • وضع البرامج النصية في أسفل الصفحة

يمكن التحكم في ضغط GZIP خوادم أباتشي به. هتكس -



SetOutputFilter DEFLATE

php_flag zlib.output_compression On
php_value zlib.output_compression_level 5

يمكنك أيضا إزالة Etags وتعيين رأس انتهاء مدة الصلاحية في. هتكس باستخدام التالية -



ExpiresActive On
ExpiresDefault "access plus 12 hours"
ExpiresByType image/gif "access plus 2 month"
ExpiresByType image/png "access plus 2 month"
ExpiresByType image/jpeg "access plus 2 month"
ExpiresByType image/ico A2592000
ExpiresByType text/javascript "access plus 2 month"
ExpiresByType text/css "access plus 2 month"
FileETag none

كيفية تمكين GZIP في Centos 5

1 . الدخول الى SSH وإنشاء ملف في الموقع التالي
/etc/httpd/conf.d/deflate.conf

2. Insert the following into the file you just created and save it
# Insert filter
SetOutputFilter DEFLATE

# Netscape 4.x has some problems...
BrowserMatch ^Mozilla/4 gzip-only-text/html

# Netscape 4.06-4.08 have some more problems
BrowserMatch ^Mozilla/4.0[678] no-gzip

# MSIE masquerades as Netscape, but it is fine
BrowserMatch bMSIE !no-gzip !gzip-only-text/html

# Don't compress images
SetEnvIfNoCase Request_URI .(?:gif|jpe?g|png)$ no-gzip dont-vary

# Don't compress already compressed stuff !
SetEnvIfNoCase Request_URI .(?:exe|t?gz|zip|bz2|sit|rar)$ no-gzip dont-vary
SetEnvIfNoCase Request_URI .pdf$ no-gzip dont-vary

# Make sure proxies don't deliver the wrong content
Header append Vary User-Agent env=!dont-vary

# Log Stuff !
# DeflateFilterNote Input input_info
# DeflateFilterNote Output output_info
# DeflateFilterNote Ratio ratio_info
# LogFormat '"%r" %{output_info}n/%{input_info}n (%{ratio_info}n%%)' deflate
# CustomLog /var/log/httpd/deflate_log deflate

3. إعادة تشغيل الأباتشي والانتهاء
/etc/init.d/httpd restart

 

اترك رد

لن عنوان بريدك الالكتروني ينشر. يتم وضع علامة الحقول المطلوبة *

*

يمكنك استخدام هذه HTML علامات وسمات: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

© ServA1
credit