Autoptimize First Byte Time problemine neden olur. Tek cache eklentisi kullanılmalıdır.


ExpiresActive On
# Images
ExpiresByType image/jpeg "access plus 1 year"
ExpiresByType image/gif "access plus 1 year"
ExpiresByType image/png "access plus 1 year"
ExpiresByType image/webp "access plus 1 year"
ExpiresByType image/svg+xml "access plus 1 year"
ExpiresByType image/x-icon "access plus 1 year"
# Video
ExpiresByType video/mp4 "access plus 1 year"
ExpiresByType video/mpeg "access plus 1 year"
# CSS, JavaScript
ExpiresByType text/css "access plus 1 month"
ExpiresByType text/javascript "access plus 1 month"
ExpiresByType application/javascript "access plus 1 month"
# Others
ExpiresByType application/pdf "access plus 1 month"
ExpiresByType application/x-shockwave-flash "access plus 1 month"


add expires için bu kodu kullanabilirsiniz. Ancak şunu belirtmem gerek, her sunucu alt yapısına göre değişkenlik gösterebilir. Bu yüzden google amca üzerinde değişik alternatifleri inceleyerek deneyebilirsiniz.

Options All -Indexes

# Disable ETags

Header unset ETag
Header set Connection keep-alive

FileETag None



Header set Access-Control-Allow-Origin "*"



########### REDIRECT TRAFFIC TO HTTPS ############
# RewriteEngine On
# RewriteCond %{HTTPS} off
# RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [R=301,L]

############ SECURITY ###########

Order allow,deny
Deny from all



Allow from all


############## CACHING-GZIP ############

ExpiresActive On
ExpiresDefault A2592000


ExpiresDefault A2592000



ExpiresDefault A2592000



ExpiresDefault A2592000



ExpiresDefault A2592000





Header set Cache-Control "max-age=2592000"



Header set Cache-Control "max-age=2592000"



Header set Cache-Control "max-age=2592000"



Header set Cache-Control "max-age=2592000"






SetEnvIfNoCase ^(Accept-EncodXng|X-cept-Encoding|X{15}|~{15}|-{15})$ ^((gzip|deflate)\s*,?\s*)+|[X~-]{4,13}$ HAVE_Accept-Encoding
RequestHeader append Accept-Encoding "gzip,deflate" env=HAVE_Accept-Encoding



AddOutputFilterByType DEFLATE "application/atom+xml" \
"application/javascript" \
"application/json" \
"application/ld+json" \
"application/manifest+json" \
"application/rdf+xml" \
"application/rss+xml" \
"application/schema+json" \
"application/vnd.geo+json" \
"application/vnd.ms-fontobject" \
"application/x-font-ttf" \
"application/x-javascript" \
"application/x-web-app-manifest+json" \
"application/xhtml+xml" \
"application/xml" \
"font/eot" \
"font/opentype" \
"image/bmp" \
"image/svg+xml" \
"image/vnd.microsoft.icon" \
"image/x-icon" \
"text/cache-manifest" \
"text/css" \
"text/html" \
"text/javascript" \
"text/plain" \
"text/vcard" \
"text/vnd.rim.location.xloc" \
"text/vtt" \
"text/x-component" \
"text/x-cross-domain-policy" \
"text/xml"



AddEncoding gzip svgz




Mesela bu kodlar bazı sitelerde mükemmel netice verdiği gibi bazılarında etkili olmayabiliyor.