{"id":491,"date":"2025-09-10T16:34:35","date_gmt":"2025-09-10T13:34:35","guid":{"rendered":"https:\/\/destek.narhost.com\/?p=491"},"modified":"2025-10-26T14:19:36","modified_gmt":"2025-10-26T11:19:36","slug":"htaccess-ile-tarayici-onbellekleme-islemi","status":"publish","type":"post","link":"https:\/\/narhost.com\/destek\/htaccess-ile-tarayici-onbellekleme-islemi\/","title":{"rendered":".htaccess ile Taray\u0131c\u0131 \u00d6nbellekleme \u0130\u015flemi"},"content":{"rendered":"<p data-start=\"449\" data-end=\"790\">Taray\u0131c\u0131 \u00f6nbellekleme, kullan\u0131c\u0131lar\u0131n web sitenize tekrar geldi\u011finde daha h\u0131zl\u0131 bir deneyim ya\u015famalar\u0131n\u0131 sa\u011flar. Dosyalar\u0131n (resimler, CSS, JavaScript gibi) belirli bir s\u00fcre boyunca taray\u0131c\u0131da saklanmas\u0131n\u0131 sa\u011flayarak, her sayfa ziyaretinde tekrar y\u00fcklenmelerine gerek kalmaz. Bunun i\u00e7in <strong data-start=\"736\" data-end=\"755\">Expires Caching<\/strong> \u00f6zelli\u011fini etkinle\u015ftirebilirsiniz.<\/p>\n<p data-start=\"792\" data-end=\"890\">A\u015fa\u011f\u0131daki kodlar\u0131 <strong data-start=\"810\" data-end=\"823\">.htaccess<\/strong> dosyan\u0131za ekleyerek taray\u0131c\u0131 \u00f6nbelleklemeyi devreye alabilirsiniz:<\/p>\n<div class=\"contain-inline-size rounded-2xl relative bg-token-sidebar-surface-primary\">\n<div class=\"sticky top-9\">\n<div class=\"absolute end-0 bottom-0 flex h-9 items-center pe-2\">\n<div class=\"bg-token-bg-elevated-secondary text-token-text-secondary flex items-center gap-4 rounded-sm px-2 font-sans text-xs\"><\/div>\n<\/div>\n<\/div>\n<div class=\"overflow-y-auto p-4\" dir=\"ltr\"><code class=\"whitespace-pre! language-apache\"><code class=\"whitespace-pre! language-apache\">## EXPIRES CACHING ##<br \/>\n# Enable Compression<\/code><\/code>AddOutputFilterByType DEFLATE application\/javascript<br \/>\nAddOutputFilterByType DEFLATE application\/rss+xml<br \/>\nAddOutputFilterByType DEFLATE application\/vnd.ms-fontobject<br \/>\nAddOutputFilterByType DEFLATE application\/x-font<br \/>\nAddOutputFilterByType DEFLATE application\/x-font-opentype<br \/>\nAddOutputFilterByType DEFLATE application\/x-font-otf<br \/>\nAddOutputFilterByType DEFLATE application\/x-font-truetype<br \/>\nAddOutputFilterByType DEFLATE application\/x-font-ttf<br \/>\nAddOutputFilterByType DEFLATE application\/x-javascript<br \/>\nAddOutputFilterByType DEFLATE application\/xhtml+xml<br \/>\nAddOutputFilterByType DEFLATE application\/xml<br \/>\nAddOutputFilterByType DEFLATE font\/opentype<br \/>\nAddOutputFilterByType DEFLATE font\/otf<br \/>\nAddOutputFilterByType DEFLATE font\/ttf<br \/>\nAddOutputFilterByType DEFLATE image\/svg+xml<br \/>\nAddOutputFilterByType DEFLATE image\/x-icon<br \/>\nAddOutputFilterByType DEFLATE text\/css<br \/>\nAddOutputFilterByType DEFLATE text\/html<br \/>\nAddOutputFilterByType DEFLATE text\/javascript<br \/>\nAddOutputFilterByType DEFLATE text\/plain<code class=\"whitespace-pre! language-apache\"><code class=\"whitespace-pre! language-apache\"><\/code><\/code># Leverage Browser Caching<\/p>\n<p><code class=\"whitespace-pre! language-apache\"><code class=\"whitespace-pre! language-apache\"><\/code><\/code>ExpiresActive On<\/p>\n<p><code class=\"whitespace-pre! language-apache\"><code class=\"whitespace-pre! language-apache\"><\/code><\/code># Images<br \/>\nExpiresByType image\/jpeg &#8220;access plus 1 year&#8221;<br \/>\nExpiresByType image\/jpg &#8220;access plus 1 year&#8221;<br \/>\nExpiresByType image\/gif &#8220;access plus 1 year&#8221;<br \/>\nExpiresByType image\/png &#8220;access plus 1 year&#8221;<br \/>\nExpiresByType image\/webp &#8220;access plus 1 year&#8221;<br \/>\nExpiresByType image\/svg+xml &#8220;access plus 1 year&#8221;<br \/>\nExpiresByType image\/x-icon &#8220;access plus 1 year&#8221;<\/p>\n<p><code class=\"whitespace-pre! language-apache\"><code class=\"whitespace-pre! language-apache\"><\/code><\/code># Video<br \/>\nExpiresByType video\/mp4 &#8220;access plus 1 year&#8221;<br \/>\nExpiresByType video\/mpeg &#8220;access plus 1 year&#8221;<\/p>\n<p><code class=\"whitespace-pre! language-apache\"><code class=\"whitespace-pre! language-apache\"><\/code><\/code># CSS, JavaScript<br \/>\nExpiresByType text\/css &#8220;access plus 1 month&#8221;<br \/>\nExpiresByType text\/javascript &#8220;access plus 1 month&#8221;<br \/>\nExpiresByType application\/javascript &#8220;access plus 1 month&#8221;<\/p>\n<p><code class=\"whitespace-pre! language-apache\"><code class=\"whitespace-pre! language-apache\"><\/code><\/code># Others<br \/>\nExpiresByType application\/pdf &#8220;access plus 1 month&#8221;<br \/>\nExpiresByType application\/x-shockwave-flash &#8220;access plus 1 month&#8221;<br \/>\nExpiresByType text\/html &#8220;access plus 600 seconds&#8221;<\/p>\n<p><code class=\"whitespace-pre! language-apache\"><code class=\"whitespace-pre! language-apache\"><\/code><\/code># Fonts<br \/>\nExpiresByType application\/vnd.ms-fontobject &#8220;access plus 1 year&#8221;<br \/>\nExpiresByType application\/x-font-ttf &#8220;access plus 1 year&#8221;<br \/>\nExpiresByType application\/x-font-opentype &#8220;access plus 1 year&#8221;<br \/>\nExpiresByType application\/x-font-woff &#8220;access plus 1 year&#8221;<\/p>\n<p><code class=\"whitespace-pre! language-apache\"><code class=\"whitespace-pre! language-apache\"><\/code><\/code>## EXPIRES CACHING ##<\/p>\n<\/div>\n<\/div>\n<p data-start=\"3116\" data-end=\"3330\">Bu kodlar ile <strong data-start=\"3130\" data-end=\"3137\">CSS<\/strong>, <strong data-start=\"3139\" data-end=\"3153\">JavaScript<\/strong>, <strong data-start=\"3155\" data-end=\"3167\">Resimler<\/strong> gibi dosyalar\u0131n ne kadar s\u00fcreyle taray\u0131c\u0131da \u00f6nbellekte tutulaca\u011f\u0131n\u0131 belirlemi\u015f olduk. Ayr\u0131ca, s\u0131k kullan\u0131lan dosya t\u00fcrlerine <strong data-start=\"3293\" data-end=\"3314\">gzip s\u0131k\u0131\u015ft\u0131rmas\u0131<\/strong> da eklenmi\u015ftir.<\/p>\n<hr data-start=\"3332\" data-end=\"3335\" \/>\n<h3 data-start=\"3337\" data-end=\"3378\"><strong data-start=\"3341\" data-end=\"3378\">GZIP S\u0131k\u0131\u015ft\u0131rmas\u0131n\u0131 Etkinle\u015ftirme<\/strong><\/h3>\n<p data-start=\"3380\" data-end=\"3638\">GZIP s\u0131k\u0131\u015ft\u0131rmas\u0131, sayfalar\u0131n\u0131z\u0131n boyutunu k\u00fc\u00e7\u00fclt\u00fcr ve sayfa y\u00fckleme s\u00fcresini azalt\u0131r. Bu s\u0131k\u0131\u015ft\u0131rma, sayfa i\u00e7eri\u011fini daha h\u0131zl\u0131 bir \u015fekilde sunucudan kullan\u0131c\u0131n\u0131n taray\u0131c\u0131s\u0131na aktar\u0131r. Bu sayede, hem sunucunun y\u00fck\u00fc azal\u0131r hem de kullan\u0131c\u0131 deneyimi h\u0131zlan\u0131r.<\/p>\n<p data-start=\"3640\" data-end=\"3735\">A\u015fa\u011f\u0131daki GZIP s\u0131k\u0131\u015ft\u0131rma kurallar\u0131n\u0131 <strong data-start=\"3678\" data-end=\"3691\">.htaccess<\/strong> dosyan\u0131za ekleyerek etkinle\u015ftirebilirsiniz:<\/p>\n<div class=\"contain-inline-size rounded-2xl relative bg-token-sidebar-surface-primary\">\n<div class=\"sticky top-9\">\n<div class=\"absolute end-0 bottom-0 flex h-9 items-center pe-2\">\n<div class=\"bg-token-bg-elevated-secondary text-token-text-secondary flex items-center gap-4 rounded-sm px-2 font-sans text-xs\"><\/div>\n<\/div>\n<\/div>\n<div class=\"overflow-y-auto p-4\" dir=\"ltr\"><code class=\"whitespace-pre! language-apache\"># GZIP S\u0131k\u0131\u015ft\u0131rma<br \/>\nmod_gzip_on Yes<br \/>\nmod_gzip_dechunk Yes<br \/>\nmod_gzip_item_include file .(html?|txt|css|js|php|pl)$<br \/>\nmod_gzip_item_include handler ^cgi-script$<br \/>\nmod_gzip_item_include mime ^text\/.*<br \/>\nmod_gzip_item_include mime ^application\/x-javascript.*<br \/>\nmod_gzip_item_exclude mime ^image\/.*<br \/>\nmod_gzip_item_exclude rspheader ^Content-Encoding:.*gzip.*<br \/>\n<\/code><\/div>\n<\/div>\n<p data-start=\"4092\" data-end=\"4248\">Bu ayar, <strong data-start=\"4101\" data-end=\"4109\">HTML<\/strong>, <strong data-start=\"4111\" data-end=\"4118\">CSS<\/strong>, <strong data-start=\"4120\" data-end=\"4134\">JavaScript<\/strong> gibi dosyalar\u0131n s\u0131k\u0131\u015ft\u0131r\u0131lmas\u0131n\u0131 sa\u011flayacakt\u0131r. Ayr\u0131ca <strong data-start=\"4190\" data-end=\"4205\">g\u00f6rsellerin<\/strong> s\u0131k\u0131\u015ft\u0131r\u0131lmamas\u0131 i\u00e7in de ayar yap\u0131lm\u0131\u015ft\u0131r.<\/p>\n<hr data-start=\"4250\" data-end=\"4253\" \/>\n<h3 data-start=\"4255\" data-end=\"4289\"><strong data-start=\"4259\" data-end=\"4289\">Taray\u0131c\u0131 \u00d6nbellek Kontrol\u00fc<\/strong><\/h3>\n<p data-start=\"4291\" data-end=\"4556\">Taray\u0131c\u0131 \u00f6nbellekleme, belirli dosyalar\u0131n taray\u0131c\u0131da ne kadar s\u00fcreyle saklanaca\u011f\u0131n\u0131 kontrol etmenize olanak sa\u011flar. Web sitenizin performans\u0131n\u0131 iyile\u015ftirmek i\u00e7in <strong data-start=\"4453\" data-end=\"4470\">Cache-Control<\/strong> ba\u015fl\u0131klar\u0131n\u0131 kullanarak dosya t\u00fcrlerine g\u00f6re \u00f6nbellek s\u00fcrelerini belirleyebilirsiniz.<\/p>\n<p data-start=\"4558\" data-end=\"4642\">A\u015fa\u011f\u0131daki <strong data-start=\"4568\" data-end=\"4585\">Cache-Control<\/strong> kurallar\u0131 ile \u00f6nbellek s\u00fcrelerini kontrol edebilirsiniz:<\/p>\n<div class=\"contain-inline-size rounded-2xl relative bg-token-sidebar-surface-primary\">\n<div class=\"sticky top-9\">\n<div class=\"absolute end-0 bottom-0 flex h-9 items-center pe-2\">\n<div class=\"bg-token-bg-elevated-secondary text-token-text-secondary flex items-center gap-4 rounded-sm px-2 font-sans text-xs\"><\/div>\n<\/div>\n<\/div>\n<div class=\"overflow-y-auto p-4\" dir=\"ltr\">\n<p><code class=\"whitespace-pre! language-apache\"># This sets up browser cache control<\/code><\/p>\n<p>&lt;filesmatch &#8220;\\.(ico|flv|jpg|jpeg|png|gif|css|swf)$&#8221;&gt;<br \/>\nHeader set Cache-Control &#8220;max-age=2678400, public&#8221;<\/p>\n<p>&lt;filesmatch &#8220;\\.(html|htm)$&#8221;&gt;<br \/>\nHeader set Cache-Control &#8220;max-age=7200, private, must-revalidate&#8221;<\/p>\n<p>&lt;filesmatch &#8220;\\.(pdf)$&#8221;&gt;<br \/>\nHeader set Cache-Control &#8220;max-age=86400, public&#8221;<\/p>\n<p>&lt;filesmatch &#8220;\\.(js)$&#8221;&gt;<br \/>\nHeader set Cache-Control &#8220;max-age=2678400, private&#8221;<\/p>\n<p># END Cache-Control Headers<\/p>\n<\/div>\n<\/div>\n<p data-start=\"5101\" data-end=\"5291\">Bu ayar, belirli dosya t\u00fcrlerinin taray\u0131c\u0131da ne kadar s\u00fcreyle saklanaca\u011f\u0131n\u0131 belirler. \u00d6rne\u011fin, resimler ve videolar 1 y\u0131l boyunca saklanacak, HTML dosyalar\u0131 ise 2 saat s\u00fcreyle saklanacakt\u0131r.<\/p>\n<hr data-start=\"5293\" data-end=\"5296\" \/>\n<h3 data-start=\"5298\" data-end=\"5311\"><\/h3>\n","protected":false},"excerpt":{"rendered":"<p>A\u015fa\u011f\u0131daki kodlar\u0131 .htaccess dosyan\u0131za ekleyerek taray\u0131c\u0131 \u00f6nbelleklemeyi devreye alabilirsiniz.<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[9,7,10,3,6,8],"tags":[21,86],"class_list":["post-491","post","type-post","status-publish","format-standard","hentry","category-web-hosting","category-wordpress-hosting","category-kurumsal-hosting","category-windows-hosting","category-linux-hosting","category-reseller-hosting","tag-hosting","tag-htaccess"],"meta_box":[],"_links":{"self":[{"href":"https:\/\/narhost.com\/destek\/wp-json\/wp\/v2\/posts\/491","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/narhost.com\/destek\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/narhost.com\/destek\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/narhost.com\/destek\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/narhost.com\/destek\/wp-json\/wp\/v2\/comments?post=491"}],"version-history":[{"count":2,"href":"https:\/\/narhost.com\/destek\/wp-json\/wp\/v2\/posts\/491\/revisions"}],"predecessor-version":[{"id":764,"href":"https:\/\/narhost.com\/destek\/wp-json\/wp\/v2\/posts\/491\/revisions\/764"}],"wp:attachment":[{"href":"https:\/\/narhost.com\/destek\/wp-json\/wp\/v2\/media?parent=491"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/narhost.com\/destek\/wp-json\/wp\/v2\/categories?post=491"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/narhost.com\/destek\/wp-json\/wp\/v2\/tags?post=491"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}