Bu yazıda, pek çok webmaster'ın sorun yaşadığı bir konu olan add expires headers çözümünü sizler ile buluşturacağım.
![]() |
add expires headers çözümü |
Add expires headers, bir web sitesinde en sık kullanılan, en sık çağrılan dosyaların indirilerek saklanmasıdır. Bu bir önbellekleme sistemidir, bu sebeple site hızınızı arttırmada size yardımcı olacaktır. Bu yüzden daha performanslı ve daha hızlı bir web sitesi için uygulanması gereklidir.
Daha geniş açıdan add expires headers ise kullanıma göre hangi dosyaların saklanılması gerektiğine karar verilmesini sağlar. Site ziyaret edildiğinde saklanmış olan dosyaların yeniden ne zaman çağrılması gerektiği add expires headers ile belirlenir. Böylece siteye tekrar giriş yapan bir kullanıcı aynı dosyalara sürekli sürekli istek göndermeyecek ve siteye daha hızlı erişim sağlayacaktır.
Add expires headers çözümü
Add expires headers çözümü ise oldukça basittir. Tek yapmanız gereken şey aşağıda yer alan kodları sitenizin .htacess dosyasına eklemektir. Bu işlemden sonra özellikle fazla ziyaretçiye sahip siteler sunucudaki yükün azalmasından dolayı oldukça rahatlayacaktır.
# Enable expirations
ExpiresActive On
# Default directive
ExpiresDefault “access plus 1 month”
# 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”
# CSS
ExpiresByType text/css “access 1 month”
# Data interchange
ExpiresByType application/json “access plus 0 seconds”
ExpiresByType application/xml “access plus 0 seconds”
ExpiresByType text/xml “access plus 0 seconds”
# Javascript
ExpiresByType application/javascript “access plus 1 year”
# Favicon (cannot be renamed!) and cursor images
# HTML components (HTCs)
ExpiresByType text/x-component “access plus 1 month”
# HTML
ExpiresByType text/html “access plus 0 seconds”
# Manifest files
ExpiresByType application/x-web-app-manifest+json “access plus 0 seconds”
ExpiresByType text/cache-manifest “access plus 0 seconds”
# Media
ExpiresByType audio/ogg “access plus 1 month”
ExpiresByType image/gif “access plus 1 month”
ExpiresByType image/jpeg “access plus 1 month”
ExpiresByType image/png “access plus 1 month”
ExpiresByType video/mp4 “access plus 1 month”
ExpiresByType video/ogg “access plus 1 month”
ExpiresByType video/webm “access plus 1 month”
# Web feeds
ExpiresByType application/atom+xml “access plus 1 hour”
ExpiresByType application/rss+xml “access plus 1 hour”
# Web fonts
ExpiresByType application/font-woff “access plus 1 month”
ExpiresByType application/vnd.ms-fontobject “access plus 1 month”
ExpiresByType application/x-font-ttf “access plus 1 month”
ExpiresByType font/opentype “access plus 1 month”
ExpiresByType image/svg+xml “access plus 1 month”