Merhabalar, uzun bir araştırma sonucu yeni bir şey buldum ve paylaşılmadığını fark ettim ve burada paylaşma gereği duydum aşağıdaki vermiş olduğumuz kodlar ünlü
Apache moderatörlerin den jdMorgan tarafından paylaşılmıştır.
Kodun işlevi: gereksiz geniş kod parçacıklarını bulup sıkıştırmaktadır. Gzip bu işlevi yeterli katar yapıyor ancak gzip yetmeyen arkadaşlar olduğu için ek olarak bu kodları kullanabilirler.
Kod Nereye ve Nasıl yerleştirilir?: Wordpressin kontrol panellerini kullarak veya oradan yapamazsanız Filezilla programı desteği ile .htaccess bölümüne yazdırın.
# if this request is for any of these filetypes
RewriteCond $1 \.gif$ [NC,OR]
RewriteCond $1 \.jpg$ [NC,OR]
RewriteCond $1 \.ico$ [NC,OR]
RewriteCond $1 \.css$ [NC,OR]
RewriteCond $1 \.js$ [NC,OR]
RewriteCond $1 \.mp3$ [NC,OR]
RewriteCond $1 \.wav$ [NC,OR]
RewriteCond $1 \.pdf$ [NC,OR]
# or if URL resolves to existing file
RewriteCond %{REQUEST_FILENAME} -f [OR]
# or if URL resolves to existing directory
RewriteCond %{REQUEST_FILENAME} -d
# then skip the rewrite to WP
RewriteRule ^(.*)$ - [S=1]
# else rewrite the request to WP
RewriteRule . /index.php [L]
Whereas in a server config file but outside of any <Directory> container, you'd want:
# if this request is for any of theses filetypes
RewriteCond $1 \.gif$ [NC,OR]
RewriteCond $1 \.jpg$ [NC,OR]
RewriteCond $1 \.ico$ [NC,OR]
RewriteCond $1 \.css$ [NC,OR]
RewriteCond $1 \.js$ [NC,OR]
RewriteCond $1 \.mp3$ [NC,OR]
RewriteCond $1 \.wav$ [NC,OR]
RewriteCond $1 \.pdf$ [NC,OR]
# or if URL resolves to existing file
RewriteCond %{REQUEST_FILENAME} -f [OR]
# or if URL resolves to existing directory
RewriteCond %{REQUEST_FILENAME} -d
# then skip the rewrite to WP
RewriteRule ^/(.*)$ - [S=1]
# else rewrite the request to WP
RewriteRule ^/. /index.php [L]
These changes have to do with differences in performance of regex-ORs versus RewriteCond [OR]s* due to the fact that code in server config files is "pre-compiled" at server start-up as opposed to being interpreted on-the-fly in .htaccess, differences in the "local URL-path" as seen by the RewriteRule, and --as stated above-- the fact that mod_rewrite processing is not re-started from the top after any rule matches, as it is in .htaccess.
In your situation, this code may not be much faster that the box-stock code provided by WP. But if you serve any images, media, or document files whatsoever, it will be faster nonetheless.