WordPress sitelerinizi herhangi bir plugin eklemeden Redis Server yazılımı aracılığıyla hızlandırabilir ve cache sisteminizi kolayca kurabilirsiniz.

Bunun için ilk olarak şu dosyayı indirin ve “wp-content” dizininin içine atın.

İndirmek için: Redis Server object dosyası tıkla indir

Şifresi: performanshosting


 

Ardından wp-config.php dosyanıza aşağıdaki 2 satır kodu ekleyin.

Not: “etiketiniz” yazan yere kendinize özel bir etiket eklemeniz gerekiyor. Mesela “alanadinizcache” şeklinde oluşturabilirsiniz. Eğer aynı sunucuda farklı sitelerde bu belirtilen etiket aynı isimde olursa bu kez siteler birbirlerini cachelemiş olurlar ve büyük erişim problemleri meydana gelir.

define( 'WP_CACHE_KEY_SALT', 'etiketiniz_' );
$redis_server = array( 'host' => '127.0.0.1', 'port' => 6379, );


 

Ek olarak şu kodları da .htaccess dosyanızın içine eklediğinizde siteniz eskisine göre çok daha hızlı çalışacaktır.


## EXPIRES CACHING ##
<IfModule mod_expires.c>
ExpiresActive On
ExpiresByType image/jpg "access 1 year"
ExpiresByType image/jpeg "access 1 year"
ExpiresByType image/gif "access 1 year"
ExpiresByType image/png "access 1 year"
ExpiresByType text/css "access 1 month"
ExpiresByType text/html "access 1 month"
ExpiresByType application/pdf "access 1 month"
ExpiresByType text/x-javascript "access 1 month"
ExpiresByType application/x-shockwave-flash "access 1 month"
ExpiresByType image/x-icon "access 1 year"
ExpiresDefault "access 1 month"
</IfModule>
## EXPIRES CACHING ##

<FilesMatch "\.(js|css|html|htm|php|xml)$">
SetOutputFilter DEFLATE
</FilesMatch>

<IfModule mod_gzip.c>
mod_gzip_on Yes
mod_gzip_dechunk Yes
mod_gzip_item_include file \.(html?|txt|css|js|php|pl)$
mod_gzip_item_include handler ^cgi-script$
mod_gzip_item_include mime ^text/.*
mod_gzip_item_include mime ^application/x-javascript.*
mod_gzip_item_exclude mime ^image/.*
mod_gzip_item_exclude rspheader ^Content-Encoding:.*gzip.*
</IfModule>