http___psychicreadings100.blogspot.com.tr_2013_07_tarayc-onbellekleme-ozelliginden.html_1.xml
1.1 3.1 4.1 4.2 4.3 5.1 6.1 7.1 7.2 7.3 7.4 8.1 8.2 8.3 9.1 10.1 11.1 12.1 13.1 14.1 15.1 16.1 17.1 17.2 17.3 18.1 18.2 18.3 19.1 20.1 21.1 21.2 22.1 22.2 22.3 22.4 23.1 23.2 23.3 23.4 24.1 25.1 27.1 28.1 29.1 30.1 31.1 32.1 33.1 34.1 35.1 36.1 37.1 38.1 39.1 40.1 41.1 42.1 43.1 44.1 45.1 46.1 47.1 48.1 50.1 51.1 52.1 54.1 55.1 56.1 57.1 58.1 59.1 60.1 61.1 63.1 64.1 64.2 65.1 66.1 67.1 68.1 70.1 71.1 72.1 73.1 74.1 75.1 76.1 77.1 78.1 79.1 80.1 81.1 82.1 83.1 84.1 85.1 86.1 87.1 88.1 89.1 90.1 91.1 92.1 93.1 94.1 95.1 96.1 97.1 98.1 100.1 101.1 102.1 105.1 108.1 111.1 114.1 117.1 118.1 118.2 119.1 122.1 125.1 128.1 131.1 134.1 135.1 136.1 136.2 136.3 137.1 138.1 138.2 138.3 138.4
- Details Published on Wednesday, 02 December 2015 13:41 Nowadays an eye catching look of your website or a perfect content can be not enough to attract the potential users. If you are a site owner you need to know that Google uses an algorithm which makes a site loading speed one of the factors influencing the site's position in the search results. So when the site loading time takes few seconds only, for internet users and google it's often too long. Statistics say that almost a half of Internet users expect a site to load in two seconds or less. It's important to take care of this, particularly that the results can be improved without much effort. There are many techniques to improve the loading time of your site. Some of theme are a basic and relatively simple. One of the solutions is a .htaccess file, which allows to introduce the basic site optimization in minutes. What is a .htaccess file? .htaccess is a configuration file for use on Apache web servers located in the root directory. It gives the ability to control a specific folder or the piece of server. Using .htaccess file we may modify the configuration of the server software to stop or start running some server functionality and features, for example (taking into account the purpose of this tutorial) we may: Where to find .htaccess file in WordPress? - optimize your site - improve page loading speed - create a diversion (internal and external) - create password protected directories - block specific IP - and many more The file should be located be in the root folder of your WordPress installation. .htaccess file name starts with a dot (.) at the beginning, which specifies that it is a hidden file. Remember to turn on "show hidden file feature" when you are trying to access your .htaccess file using FTP client or cPanel of your hosting. Why You can not find .htaccess file? It may occure that your WordPress site has not generated a .htaccess file yet. It is generated when you set up permalinks on Settings >> Permalinks settings. Simply click on “Save Changes” button to force WordPress to generate a .htaccess file in your site’s root directory. If at this step you got a problem with file genereting, at first check permissions of the directory, must be writable. Optionally if .htaccess file does not exists, you can create it and upload. It's worth to mention that not all servers support using .htaccess file (for example free servers) and the service may be blocked - take it into account when something goes wrong while creating the file. Optimization code for .htaccess file Compression Compression simply reduces the size of document. Is most effective for HTML files, JavaScripts, CSS stylesheets and XML files. Generally compression reduces 60% to 80% size of data. This reduces also server response time and bandwidth - volume of data which must be sent by server to client browser. The best way to enable compression is using mod_gzip or mod_deflate for Apache software (or equivalent for other web server). Both modules basically do the same thing, compress data, but mod_deflate is better supported and documented, also easier to configure. If mod_deflate doesn’t work correctly on your website or web server for some reason of course you can use mod_gzip. Both compressions methods can be enabled by adding a simple code in WordPress .htaccess file:DEFLATE # BEGIN DEFLATE COMPRESSION GZIP # Compress HTML, CSS, JavaScript, Text, XML and fonts AddOutputFilterByType DEFLATE application/javascript AddOutputFilterByType DEFLATE application/rss+xml AddOutputFilterByType DEFLATE application/vnd.ms-fontobject AddOutputFilterByType DEFLATE application/x-font AddOutputFilterByType DEFLATE application/x-font-opentype AddOutputFilterByType DEFLATE application/x-font-otf AddOutputFilterByType DEFLATE application/x-font-truetype AddOutputFilterByType DEFLATE application/x-font-ttf AddOutputFilterByType DEFLATE application/x-javascript AddOutputFilterByType DEFLATE application/xhtml+xml AddOutputFilterByType DEFLATE application/xml AddOutputFilterByType DEFLATE font/opentype AddOutputFilterByType DEFLATE font/otf AddOutputFilterByType DEFLATE font/ttf AddOutputFilterByType DEFLATE image/svg+xml AddOutputFilterByType DEFLATE image/x-icon AddOutputFilterByType DEFLATE text/css AddOutputFilterByType DEFLATE text/html AddOutputFilterByType DEFLATE text/javascript AddOutputFilterByType DEFLATE text/plain AddOutputFilterByType DEFLATE text/xml # END DEFLATE COMPRESSION # BEGIN GZIP COMPRESSION Browser Caching 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.* # END GZIP COMPRESSION By setting browser caching you’re telling browser to keep some kind of files for a specified period of time in local memory (cache). When cached file is needed again, the browser will load from its local drive instead of requesting it from the server. We can use for that purpose two Apache modules - mod_expires and mod_headers (or equivalent for other web server). Both methods can be set at the same time in .htaccess file:Expires headers #BEGIN EXPIRES HEADERS Cache-Control # Enable expirations ExpiresActive On # Default expiration: 1 hour after request ExpiresDefault "now plus 1 hour" # CSS and JS expiration: 1 week after request ExpiresByType text/css "now plus 1 week" ExpiresByType application/javascript "now plus 1 week" ExpiresByType application/x-javascript "now plus 1 week" # Image files expiration: 1 month after request ExpiresByType image/bmp "now plus 1 month" ExpiresByType image/gif "now plus 1 month" ExpiresByType image/jpeg "now plus 1 month" ExpiresByType image/jp2 "now plus 1 month" ExpiresByType image/pipeg "now plus 1 month" ExpiresByType image/png "now plus 1 month" ExpiresByType image/svg+xml "now plus 1 month" ExpiresByType image/tiff "now plus 1 month" ExpiresByType image/vnd.microsoft.icon "now plus 1 month" ExpiresByType image/x-icon "now plus 1 month" ExpiresByType image/ico "now plus 1 month" ExpiresByType image/icon "now plus 1 month" ExpiresByType text/ico "now plus 1 month" ExpiresByType application/ico "now plus 1 month" # Webfonts ExpiresByType font/truetype "access plus 1 month" ExpiresByType font/opentype "access plus 1 month" ExpiresByType application/x-font-woff "access plus 1 month" ExpiresByType image/svg+xml "access plus 1 month" ExpiresByType application/vnd.ms-fontobject "access plus 1 month" #END EXPIRES HEADERS # BEGIN Cache-Control Headers Note: Header set Cache-Control "public" Header set Cache-Control "public" Header set Cache-Control "private" Header set Cache-Control "private, must-revalidate" # END Cache-Control Headers There is no need to set the max-age directive with the Cache-Control header since it is already set by the mod_expires module. In other case we should use : # BEGIN Cache-Control Headers Header set Cache-Control "max-age=2592000, public" Header set Cache-Control "max-age=604800, public" Header set Cache-Control "max-age=216000, private" Header set Cache-Control "max-age=600, private, must-revalidate" # END Cache-Control Headers How to speed up WordPress site - images optimization, part 2. Do you like the tutorial? Please share! Thanks :) About the author Joomla, coding, seo optimization specialist. Marcin Merchel is related with Joomla-Monster.com for many years. He is a senior product quality reviewer which makes him an expert at choosing most effective direction in improving products according to the latest web standards and trends. His advanced knowledge of ins and outs of coding and Joomla management allows him to give absorbing speeches and gather a crowd of listeners at Joomla conferences.
1.1 2.1 3.1 4.1 5.1 6.1 7.1 8.1 10.1 11.1 12.1 13.1 14.1 15.1 16.1 17.1 18.1 20.1 22.1 24.1 26.1 28.1 30.1 32.1 34.1 36.1 39.1 40.1 41.1
Siteniz için hızlandırma çalışması yapıyorsanız referans olarak Google Page Speed Insight aracını kullanabilirsiniz. Şimdilik sadece bir parametreden ve çözümünden bahsedeceğim. Eğer sitenizde özel bir cache eklentisi kullanmıyorsanız bu yönteme ihtiyacınız olabilir. Zira sitenizde bulunan indirilebilir ve ön belleklenebilir öğelerin sitenize her girildiğinde tekrar tekrar indirilip yavaş açılmasına neden olmasını istemiyorsanız yazının devamında çözümü bulabilirsiniz. Genel anlamda çalışmalar Google bazlı yapıldığı için Google tarafından yönetilen araçları kullanmak mantıklı olacaktır. Örneğin şuradaki aracı kullanarak sitenizin maksimum hıza erişmesini sağlayabilirsiniz. Burada test yaptığınız zaman eğer ki karşınıza şöyle bir uyarı çıkıyorsa bu yöntemle kendi sunucunuza ait dosyaların tarayıcı tarafından önbelleğe kaydedilmesini sağlayabilirsiniz. Kendi sunucunuz diyorum çünkü sitenizde yer alan dış kaynaklı imajları bu yöntemle cache almasını sağlayamazsınız. İşte yapılacaklar. Öncelikle .htaccess dosyamızın yedeğini alalım. Daha sonra şu kodu dosyanın en sonuna ekleyelim. # Expires Headers - 2678400s = 31 days ExpiresActive On ExpiresDefault "access plus 2678400 seconds" ExpiresByType text/html "access plus 7200 seconds" ExpiresByType image/gif "access plus 2678400 seconds" ExpiresByType image/jpeg "access plus 2678400 seconds" ExpiresByType image/png "access plus 2678400 seconds" ExpiresByType text/css "access plus 750000 seconds" ExpiresByType text/javascript "access plus 2678400 seconds" ExpiresByType application/x-javascript "access plus 2678400 seconds" # Cache Headers # Cache specified files for 31 days Header set Cache-Control "max-age=2678400, public" # Cache HTML files for a couple hours Header set Cache-Control "max-age=7200, private, must-revalidate" # Cache PDFs for a day Header set Cache-Control "max-age=86400, public" # Cache Javascripts for 31 days Header set Cache-Control "max-age=2678400, private" Burada da görüldüğü gibi, sitenizde sık güncellenen içeriğin ön bellek süresini kısaltırken, güncellenmeyen ya da uzun süre güncellenmesi gerekmeyen dosyaları da ön bellek süresini uzatarak kaydedilmesini sağlayabiliriz. İşlemimiz bu kadar, şimdi Google Page Speed Insight aracını kullanarak işe yarayıp yaramadığını görebilirsiniz. Tarayıcı önbellekleme özelliğinden yararlanın