3 روش کاربردی برای فعال سازی gzip در وردپرس

۳ روش کاربردی برای فعال سازی gzip در وردپرس

جی زیپ کمپرس وردپرس gzip چیست فشرده سازی سایت وردپرسی

۳ روش کاربردی برای فعال سازی gzip در وردپرس که میتونه سرعت سرعت لود سایت شما را در gtmetrix به شدت افزایش بده و سایت رو از B یا D به A برسونه و حتی حجم سایتتونو تا ۵۰ درصد کم کنه.

فعال سازی جی زیپ در وردپرس Enable Gzip Compression

فعال سازی gzip در وردپرس

شاید بپرسید چرا سرعت لود سایت باید زیاد باشد و سایت سریع دیده شود؟ جوابش سادست چون کاربران سایت شما را ترک نکنند و بانس ریت سایت شما زیاد نشود.

جی زیپ یا همان GZIP Compression روشی است برای بهبود سرعت لود سایت به این گونه که تصاویر سایت در اولین درخواست لود نمیشن و در ادامه بارگذاری سایت نمایش داده می شوند و همه به صورت یک فایل فشرده به سمت کلاینت ارسال می گردند و آنجا از حالت فشرده خارج شده و به نمایش در می آیند، در منبعی که ما به بررسی آن می پردازیم سه روش برای فشرده سازی حجم سایت بیان شده که این ۳ روش کاربردی برای فعال سازی gzip در وردپرس که توسط ما توصیه می شوند به انزمام فایل تست شده برای جوملا و حذف یک روش موجود در سایت منبع که استفاده از افزونه W3 total cache هست می شود مجموعا همان سه روش که افزایش سرعت لود سایت جوملا و یا افزایش سرعت لود سایت وردپرس یا هر سایت دیگری هم میتونه از این طریق به سادگی انجام بشه چرا که با افزودن دستوراتی که در ادامه خواهد آمد شما می توانید به سادگی تعداد درخواست های سرور را کم کرده و سرعت لود سایت را کاهش دهید.

 

خدمات اصلی عصر اطلاعات به کاربران چیست؟؟

کاهش رتبه الکسا

آموزش سئو وردپرس

خدمات سئو

بک لینک

 

خوب همانطور که گفتیم روش اول سایت منبع که استفاده از افزونه توتال کش بود را به دلایل پیچیده بودن این افزونه و برخی مشکلاتی که به وجود می آورد برای سایت از آموزش ما حذف شده و ما به دو نکته دیگه اشاره می کنیم و دو فایل اچ تی اکسز که می توانند سرعت لود هر سایت برپایه پی اچ پی را افزایش دهند و زمان لود شدن را کاهش دهند خدمت شما عزیزان برای اولین بار در بین سایت های مرجع ایرانی تقدیم حظورتان می کنیم.

روش های فعال سازی gzip در وردپرس

خوب روش اول استفاده از افزونه  WP HTTP Compression است که خوب طبق بررسی انجام شده این افزونه دوسال است آپدیت نشده و ما هم استفاده از آن را توصیه نمی کنیم ولی به جای آن استفاده از افزونه افزایش سرعت وردپرس را بهتون توصیه میکنیم چرا که هیچ گونه باگی در آن دیده نشده و یوزرفرندلی بالایی دارد.

و خوب افزونه  مناسب برای جوملا هم هست که می توانید در نت سرچ کنید و از آنها استفاده کنید.

و اما فایل .htaccess متناسب با جوملا برای  افزایش سرعت لود سایت جوملا :

# BEGIN WpFastestCache
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{HTTP_HOST} ^www.samenalhojajtkd.ir [NC]
RewriteRule ^(.*)$ http\:\/\/samenalhojajtkd\.ir\/$1 [R=301,L]
RewriteCond %{REQUEST_METHOD} !POST
RewriteCond %{HTTPS} !=on
RewriteCond %{REQUEST_URI} !(\/){2}$
RewriteCond %{QUERY_STRING} !.+
RewriteCond %{HTTP:Cookie} !(comment_author_|wordpress_logged_in|wp_woocommerce_session)
RewriteCond %{HTTP:X-Wap-Profile} !^[a-z0-9\”]+ [NC]
RewriteCond %{HTTP:Profile} !^[a-z0-9\”]+ [NC]
RewriteCond %{HTTP_USER_AGENT} !^.*(iphone|midp|sony|symbos|nokia|samsung

|mobile|epoc|ericsson|panasonic|philips|sanyo|sharp|sie-|portalmmm|blazer|avantgo|danger|palm

|series60|palmsource|pocketpc|android|blackberry

|playbook|ipad|ipod|iemobile|palmos|webos|googlebot-mobile|bb10|xoom|p160u|nexus

|touch|SCH-I800|opera\smini|SM-G900R4|LG-|HTC|GT-I9505|WAP-Browser|Nokia309|Casper_VIA).*$ [NC]
RewriteCond %{DOCUMENT_ROOT}/wp-content/cache/all/$1/index.html -f [or]
RewriteCond /home/asreinfo/public_html/samenalhojajtkd.ir/wp-content/cache/all/$1/index.html -f
RewriteRule ^(.*) “/wp-content/cache/all/$1/index.html” [L]
</IfModule>
<FilesMatch “\.(html|htm)$”>
AddDefaultCharset UTF-8
<ifModule mod_headers.c>
FileETag None
Header unset ETag
Header set Cache-Control “max-age=0, no-cache, no-store, must-revalidate”
Header set Pragma “no-cache”
Header set Expires “Mon, 29 Oct 1923 20:30:00 GMT”
</ifModule>
</FilesMatch>
# END WpFastestCache
# BEGIN GzipWpFastestCache
<IfModule mod_deflate.c>
AddType x-font/woff .woff
AddOutputFilterByType DEFLATE image/svg+xml
AddOutputFilterByType DEFLATE text/plain
AddOutputFilterByType DEFLATE text/html
AddOutputFilterByType DEFLATE text/xml
AddOutputFilterByType DEFLATE text/css
AddOutputFilterByType DEFLATE text/javascript
AddOutputFilterByType DEFLATE application/xml
AddOutputFilterByType DEFLATE application/xhtml+xml
AddOutputFilterByType DEFLATE application/rss+xml
AddOutputFilterByType DEFLATE application/javascript
AddOutputFilterByType DEFLATE application/x-javascript
AddOutputFilterByType DEFLATE application/x-font-ttf
AddOutputFilterByType DEFLATE application/vnd.ms-fontobject
AddOutputFilterByType DEFLATE font/opentype font/ttf font/eot font/otf
</IfModule>
# END GzipWpFastestCache
# BEGIN LBCWpFastestCache
<FilesMatch “\.(?i:ico|pdf|flv|jpg|jpeg|png|gif|js|css|swf|x-html|css|xml|js|woff|woff2|ttf|svg|eot)(\.gz)?$”>
<IfModule mod_expires.c>
ExpiresActive On
ExpiresDefault A0
ExpiresByType image/gif A2592000
ExpiresByType image/png A2592000
ExpiresByType image/jpg A2592000
ExpiresByType image/jpeg A2592000
ExpiresByType image/ico A2592000
ExpiresByType image/svg+xml A2592000
ExpiresByType text/css A2592000
ExpiresByType text/javascript A2592000
ExpiresByType application/javascript A2592000
ExpiresByType application/x-javascript A2592000
</IfModule>
<IfModule mod_headers.c>
Header set Expires “max-age=2592000, public”
Header unset ETag
Header set Connection keep-alive
FileETag None
</IfModule>
</FilesMatch>
# END LBCWpFastestCache
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ – [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
# END WordPress
##
# @package Joomla
# @copyright Copyright (C) 2005 – 2016 Open Source Matters. All rights reserved.
# @license GNU General Public License version 2 or later; see LICENSE.txt
##

##
# READ THIS COMPLETELY IF YOU CHOOSE TO USE THIS FILE!
#
# The line just below this section: ‘Options +FollowSymLinks’ may cause problems
# with some server configurations. It is required for use of mod_rewrite, but may already
# be set by your server administrator in a way that disallows changing it in
# your .htaccess file. If using it causes your server to error out, comment it out (add # to
# beginning of line), reload your site in your browser and test your sef url’s. If they work,
# it has been set by your server administrator and you do not need it set here.
##

## No directory listings
IndexIgnore *

## Can be commented out if causes errors, see notes above.
Options +FollowSymlinks
Options -Indexes

## Mod_rewrite in use.

RewriteEngine On

## Begin – Rewrite rules to block out some common exploits.
# If you experience problems on your site block out the operations listed below
# This attempts to block the most common type of exploit `attempts` to Joomla!
#
# Block out any script trying to base64_encode data within the URL.
RewriteCond %{QUERY_STRING} base64_encode[^(]*\([^)]*\) [OR]
# Block out any script that includes a <script> tag in URL.
RewriteCond %{QUERY_STRING} (<|%3C)([^s]*s)+cript.*(>|%3E) [NC,OR]
# Block out any script trying to set a PHP GLOBALS variable via URL.
RewriteCond %{QUERY_STRING} GLOBALS(=|\[|\%[0-9A-Z]{0,2}) [OR]
# Block out any script trying to modify a _REQUEST variable via URL.
RewriteCond %{QUERY_STRING} _REQUEST(=|\[|\%[0-9A-Z]{0,2})
# Return 403 Forbidden header and show the content of the root homepage
RewriteRule .* index.php [F]
#
## End – Rewrite rules to block out some common exploits.

## Begin – Custom redirects
#
# If you need to redirect some pages, or set a canonical non-www to
# www redirect (or vice versa), place that code here. Ensure those
# redirects use the correct RewriteRule syntax and the [R=301,L] flags.
#
## End – Custom redirects

##
# Uncomment following line if your webserver’s URL
# is not directly related to physical file paths.
# Update Your Joomla! Directory (just / for root).
##

# RewriteBase /

## Begin – Joomla! core SEF Section.
#
RewriteRule .* – [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
#
# If the requested path and file is not /index.php and the request
# has not already been internally rewritten to the index.php script
RewriteCond %{REQUEST_URI} !^/index\.php
# and the requested path and file doesn’t directly match a physical file
RewriteCond %{REQUEST_FILENAME} !-f
# and the requested path and file doesn’t directly match a physical folder
RewriteCond %{REQUEST_FILENAME} !-d
# internally rewrite the request to the index.php script
RewriteRule .* index.php [L]
#
## End – Joomla! core SEF Section.
<FilesMatch “.(ico|pdf|flv|jpg|jpeg|png|gif|js|css|swf)$”>
Header set Expires “Thu, 21 Apr 2016 20:00:00 GMT”
</FilesMatch>
<ifModule mod_deflate.c>
AddOutputFilterByType DEFLATE text/html text/xml text/css text/plain
AddOutputFilterByType DEFLATE image/svg+xml application/xhtml+xml application/xml
AddOutputFilterByType DEFLATE application/rdf+xml application/rss+xml application/atom+xml
AddOutputFilterByType DEFLATE text/javascript application/javascript application/x-javascript application/json
AddOutputFilterByType DEFLATE application/x-font-ttf application/x-font-otf
AddOutputFilterByType DEFLATE font/truetype font/opentype
</ifModule>
# compress text, html, javascript, css, xml:
AddOutputFilterByType DEFLATE text/plain
AddOutputFilterByType DEFLATE text/html
AddOutputFilterByType DEFLATE text/xml
AddOutputFilterByType DEFLATE text/css
AddOutputFilterByType DEFLATE application/xml
AddOutputFilterByType DEFLATE application/xhtml+xml
AddOutputFilterByType DEFLATE application/rss+xml
AddOutputFilterByType DEFLATE application/javascript
AddOutputFilterByType DEFLATE application/x-javascript

# Or, compress certain file types by extension:

SetOutputFilter DEFLATE

و اما فایل اچ تی اکسز مورد تایید ما برای افزایش سرعت لود سایت وردپرسی

# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ – [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
# END WordPress
# ———————————————————————-
# Expires headers (for better cache control)
# ———————————————————————-

#
# These are pretty far-future expires headers
# They assume you control versioning with cachebusting query params like:
# <script src=”application.js?20100608″>
# Additionally, consider that outdated proxies may miscache
#
# www.stevesouders.com/blog/2008/08/23/revving-filenames-dont-use-querystring/

#
# If you don`t use filenames to version, lower the css and js to something like “access plus 1 week”
#

<IfModule mod_expires.c>
ExpiresActive on

# Perhaps better to whitelist expires rules? Perhaps.
ExpiresDefault “access plus 1 month”

# cache.appcache needs re-requests in FF 3.6 (thx Remy ~Introducing HTML5)
ExpiresByType text/cache-manifest “access plus 0 seconds”

# Your document html
ExpiresByType text/html “access plus 0 seconds”

# Data
ExpiresByType text/xml “access plus 0 seconds”
ExpiresByType application/xml “access plus 0 seconds”
ExpiresByType application/json “access plus 0 seconds”

# RSS feed
ExpiresByType application/rss+xml “access plus 1 hour”

# Favicon (cannot be renamed)
ExpiresByType image/x-icon “access plus 1 week”

# Media: images, video, audio
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”
ExpiresByType video/ogg “access plus 1 month”
ExpiresByType audio/ogg “access plus 1 month”
ExpiresByType video/mp4 “access plus 1 month”
ExpiresByType video/webm “access plus 1 month”

# HTC files (css3pie)
ExpiresByType text/x-component “access plus 1 month”

# Webfonts
ExpiresByType font/truetype “access plus 1 month”
ExpiresByType font/opentype “access plus 1 month”
ExpiresByType application/x-font-woff “access plus 1 month”
ExpiresByType image/svg+xml “access plus 1 month”
ExpiresByType application/vnd.ms-fontobject “access plus 1 month”

# CSS and JavaScript
ExpiresByType text/css “access plus 1 year”
ExpiresByType application/javascript “access plus 1 year”
ExpiresByType text/javascript “access plus 1 year”

<IfModule mod_headers.c>
Header append Cache-Control “public”
</IfModule>

</IfModule>
# compress text, html, javascript, css, xml:
AddOutputFilterByType DEFLATE text/plain
AddOutputFilterByType DEFLATE text/html
AddOutputFilterByType DEFLATE text/xml
AddOutputFilterByType DEFLATE text/css
AddOutputFilterByType DEFLATE application/xml
AddOutputFilterByType DEFLATE application/xhtml+xml
AddOutputFilterByType DEFLATE application/rss+xml
AddOutputFilterByType DEFLATE application/javascript
AddOutputFilterByType DEFLATE application/x-javascript
AddType x-font/otf .otf
AddType x-font/ttf .ttf
AddType x-font/eot .eot
AddType x-font/woff .woff
AddType image/x-icon .ico
AddType image/png .png

این دستورات را به طور کامل می توانید جایگزین تمامی دستورات اچ تی اکسز وردپرس نمایید و مشکلی برایتان ایجاد نخواهد کرد.

افزونه افزایش سرعت وردپرس جوملا

همچنین افزونه Wp-cleanup را حتما دانلود و نصب کنید و از زیر منوی تنظیمات به بررسی و پاک سازی دیتابیس خود از رونوشت ها و… بپردازید که تاثیر بسیاری خواهد داشت.

کد های بیشتر و بدون ارور را از منابع زیر دریافت کنید….(اصلاحیه ۲۰ مرداد ۹۶)

منبع

منبع ۲

شما می توانید آموزش سئو را در سایت سئو ۶ مطالعه نمایید.

منبع : سئو ۶