{"id":7203,"date":"2017-06-14T06:00:00","date_gmt":"2017-06-14T10:00:00","guid":{"rendered":"http:\/\/blog.litespeedtech.com\/?p=7203"},"modified":"2017-06-14T06:00:00","modified_gmt":"2017-06-14T10:00:00","slug":"wpw-crawl-your-site-make-it-fly","status":"publish","type":"post","link":"https:\/\/lswp.store\/index.php\/2017\/06\/14\/wpw-crawl-your-site-make-it-fly\/","title":{"rendered":"WpW: Crawl Your Site; Make it Fly!"},"content":{"rendered":"<p><a href=\"https:\/\/lswp.store\/wp-content\/uploads\/2017\/07\/wpw06.jpg\"><img fetchpriority=\"high\" decoding=\"async\" class=\"aligncenter size-full wp-image-8150\" src=\"https:\/\/lswp.store\/wp-content\/uploads\/2017\/07\/wpw06.jpg\" alt=\"WordPress Cache Crawler\" width=\"640\" height=\"320\" srcset=\"https:\/\/lswp.store\/wp-content\/uploads\/2017\/07\/wpw06.jpg 640w, https:\/\/lswp.store\/wp-content\/uploads\/2017\/07\/wpw06-300x150.jpg 300w, https:\/\/lswp.store\/wp-content\/uploads\/2017\/07\/wpw06-600x300.jpg 600w\" sizes=\"(max-width: 640px) 100vw, 640px\" \/><\/a><\/p>\n<p>Welcome to another installment of <a href=\"http:\/\/blog.litespeedtech.com\/tag\/wordpress-wednesday\">WordPress Wednesday<\/a>!<br \/>\nToday&#8217;s Topic:\u00a0<strong>LiteSpeed&#8217;s WordPress Cache Crawler<\/strong><\/p>\n<p>We\u2019re going to talk about<b> the concept of \u201ccrawling\u201d and why it has the potential to make your WordPress site even faster<\/b>.<\/p>\n<h2>What does a crawler do?<\/h2>\n<p>Our <a href=\"https:\/\/wordpress.org\/plugins\/litespeed-cache\/\">LiteSpeed Cache for WordPress plugin<\/a> includes crawler functionality. What does this mean?<\/p>\n<p>LSCache\u2019s crawler, travels its way throughout the backend, refreshing pages that have expired in the cache. The purpose is to keep the cache as fresh as possible while minimizing visitor exposure to uncached content.<\/p>\n<p><strong>IMPORTANT NOTE: <\/strong><span style=\"font-weight: 400;\">Crawler functionality is enabled or disabled at the server level, and its availability is controlled by your hosting provider. We\u2019ll talk about that more below, or you can see <a href=\"https:\/\/docs.litespeedtech.com\/lscache\/lscwp\/admin\/#enabling-and-limiting-the-crawler\">our docs on how to enable the crawler<\/a>.<\/span><\/p>\n<p><img decoding=\"async\" class=\"aligncenter wp-image-7303 size-large\" src=\"https:\/\/lswp.store\/wp-content\/uploads\/2017\/06\/wpw06a-1024x682.jpg\" alt=\"WordPress Cache Crawler\" width=\"1024\" height=\"682\" srcset=\"https:\/\/lswp.store\/wp-content\/uploads\/2017\/06\/wpw06a-1024x682.jpg 1024w, https:\/\/lswp.store\/wp-content\/uploads\/2017\/06\/wpw06a-300x200.jpg 300w, https:\/\/lswp.store\/wp-content\/uploads\/2017\/06\/wpw06a-768x512.jpg 768w, https:\/\/lswp.store\/wp-content\/uploads\/2017\/06\/wpw06a-1536x1024.jpg 1536w, https:\/\/lswp.store\/wp-content\/uploads\/2017\/06\/wpw06a-1320x880.jpg 1320w, https:\/\/lswp.store\/wp-content\/uploads\/2017\/06\/wpw06a-600x400.jpg 600w, https:\/\/lswp.store\/wp-content\/uploads\/2017\/06\/wpw06a.jpg 2000w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/p>\n<h2>Why would we want to do this?<\/h2>\n<p>Well, first let\u2019s look at how pages are cached <i>without <\/i>a crawler. The whole process is initiated by user request. The cache is empty until users start sending requests to the backend. The first time a page is visited, the request hits the backend, WordPress\u2019s PHP code is invoked to generate the page, the page is served to the user, and then stored in cache for next time.<\/p>\n<p>That\u2019s a fairly time-consuming (and bandwidth-consuming!) process for the server.<\/p>\n<p>Now, let\u2019s look at what happens when the cache is built by a crawler. When the crawler requests a page, the request hits the backend, WordPress\u2019s PHP code is invoked to generate the page, but because of the special header that lets LSWS know that this is a crawler that initiated the request, the full page doesn\u2019t need to be served. It is simply stored in cache.<\/p>\n<p>This saves significant bandwidth.<\/p>\n<p>Additionally, with the crawler refreshing expired pages at regular intervals, the chances that a user will encounter an uncached page is significantly diminished. This makes for a faster site.<\/p>\n<h2>Let\u2019s look at some settings<\/h2>\n<p>You want the crawler to be effective in its mission, but not at the expense of your system\u2019s performance. It\u2019s helpful to know what some of the settings mean, so you can control just how many resources you want to give to the crawling process.<\/p>\n<p><strong>Note<\/strong>: We&#8217;ve selected default settings that should be reasonable for most sites, so if you don&#8217;t want to be messing around with these settings, it&#8217;s fine to leave them as-is.<\/p>\n<p>Navigate to <b>WP-Admin &gt; LiteSpeed Cache &gt; Crawler &gt; General Settings<\/b> and take a look at the following settings:<\/p>\n<p><img decoding=\"async\" class=\"alignnone wp-image-12119 size-large\" src=\"https:\/\/lswp.store\/wp-content\/uploads\/2017\/06\/crawler-settings1-updated-1024x641.png\" alt=\"LSCache for WordPress Crawler General Settings\" width=\"1024\" height=\"641\" srcset=\"https:\/\/lswp.store\/wp-content\/uploads\/2017\/06\/crawler-settings1-updated-1024x641.png 1024w, https:\/\/lswp.store\/wp-content\/uploads\/2017\/06\/crawler-settings1-updated-300x188.png 300w, https:\/\/lswp.store\/wp-content\/uploads\/2017\/06\/crawler-settings1-updated-768x481.png 768w, https:\/\/lswp.store\/wp-content\/uploads\/2017\/06\/crawler-settings1-updated-600x376.png 600w, https:\/\/lswp.store\/wp-content\/uploads\/2017\/06\/crawler-settings1-updated.png 1033w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/p>\n<h3>Crawler<\/h3>\n<p>This setting allows you to enable (<code>ON<\/code>) or disable (<code>OFF<\/code>) the crawler. It defaults to <code>OFF<\/code>.<\/p>\n<h3>Delay<\/h3>\n<p>The crawler sends requests to the backend, one page after another, as it traverses your site. This can put a heavy load on your server if there is no pause between requests. Set the <b>Delay<\/b> to let LSCache know how often to send a new request to the server. The default is <code>500<\/code> microseconds (or 0.0005 seconds). You can increase this amount to lessen the load on the server, just be aware that will make the entire crawling process take longer.<\/p>\n<h3>Run Duration<\/h3>\n<p>In order to keep your server from getting bogged-down with behind-the-scenes crawling, you can put limits on the crawling duration. For example, if we set <b>Run Duration<\/b> to <code>400<\/code> seconds, then the crawler will run for 6.66667 minutes before taking a break. After the break is over, the crawler will start back up exactly where it left off and run for another 400 seconds. This will continue until LiteSpeed crawls the entire site.<\/p>\n<h3>Interval Between Runs<\/h3>\n<p>This setting determines the length of the break mentioned above. In that same example, if we set <b>Interval Between Runs<\/b> to <code>600<\/code> seconds, then the crawler would pause for 10 minutes after every 1-minute run.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-12121 size-large\" src=\"https:\/\/lswp.store\/wp-content\/uploads\/2017\/06\/crawler-settings2-updated-1024x594.png\" alt=\"LSCache for WordPress Crawler General Settings\" width=\"1024\" height=\"594\" srcset=\"https:\/\/lswp.store\/wp-content\/uploads\/2017\/06\/crawler-settings2-updated-1024x594.png 1024w, https:\/\/lswp.store\/wp-content\/uploads\/2017\/06\/crawler-settings2-updated-300x174.png 300w, https:\/\/lswp.store\/wp-content\/uploads\/2017\/06\/crawler-settings2-updated-768x446.png 768w, https:\/\/lswp.store\/wp-content\/uploads\/2017\/06\/crawler-settings2-updated-600x348.png 600w, https:\/\/lswp.store\/wp-content\/uploads\/2017\/06\/crawler-settings2-updated.png 1056w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/p>\n<h3>Crawl Interval<\/h3>\n<p>How often do you want to re-initiate the crawling process? This depends on how long it takes to crawl your site. The best way to figure this out is to run the crawler a couple of times and keep track of the elapsed time. Once you\u2019ve got that amount, set the interval to slightly more than that. For example, if your crawler routinely takes 4 hours to complete a run, you could set the interval to 5 hours (or <code>18000<\/code> seconds).<\/p>\n<h3>Threads<\/h3>\n<p>When <b>Threads<\/b> is set to <code>3<\/code>, then there are 3 separate crawling processes happening concurrently. The higher the number, the faster LiteSpeed crawls your site, but also the more load that the crawler puts on your server.<\/p>\n<h3>Timeout<\/h3>\n<p>Use this setting to specify how long you are willing to take processing a single URL. The crawler has this many seconds to crawl a page before moving on to the next page. The default is <code>30<\/code>, but you can adjust that up or down according to your needs.<\/p>\n<h3>Server Load Limit<\/h3>\n<p>This setting is a way to keep the crawler from monopolizing system resources. Once the server&#8217;s load average reaches this limit, the crawler will be terminated, rather than allowing it to compromise server performance.<\/p>\n<p>For example, to terminate the crawler once half of your server resources are being consumed, set <strong>Server Load Limit<\/strong>\u00a0to\u00a0<code>0.5<\/code>\u00a0for a one-core server,\u00a0<code>1<\/code>\u00a0for a two-core server,\u00a0<code>2<\/code>\u00a0for a four-core server, and so on.<\/p>\n<h2>Protecting your server from overload<\/h2>\n<p>We designed all of the settings above to work together to protect your server from overload. The first four parameters (<strong>Delay<\/strong>, <strong>Run Duration<\/strong>, <strong>Interval Between Runs<\/strong>, and <strong>Crawl Interval<\/strong>) control how often and for how long to allow the crawler to run. You can set these values to give your crawler as many or as few resources as your system can afford.<\/p>\n<p><strong>Timeout<\/strong> keeps the crawler from getting stuck for too long on any one page.<\/p>\n<p><strong>Threads<\/strong> and <strong>Server Load Limit<\/strong> are two settings that work together to automatically terminate the crawler if it tries to get too greedy with system resources. Here\u2019s an example:<\/p>\n<p>Let\u2019s say we have the following values set before the crawler starts:<\/p>\n<p><strong>Server Load Limit<\/strong> = <code>5<\/code><br \/>\n<strong>Threads <\/strong>= <code>4<\/code><\/p>\n<p>The current server load is at 2, and the crawler begins. It\u2019s crawling 4 urls at a time (due to the <strong>Threads<\/strong> setting), but this has caused the server load to jump up above our limit of 5. In response, the crawler drops the number of threads to 3 and keeps going.<\/p>\n<p>If the server load hits our limit of 5 again, the crawler will drop the number of threads to 2 and go on. This process repeats until we are down to a single thread.<\/p>\n<p>If the server load is still too high with only one crawler thread, the crawling process terminates.<\/p>\n<p>On the other hand, if the server is doing just fine with one thread, the crawler will increase the number of threads one at a time, until it has either reached the <strong>Thread Limit<\/strong> we set (4 in this case) or our <strong>Server Load Limit<\/strong>.<\/p>\n<h2>Watching the crawler do its thing<\/h2>\n<p>If you\u2019re the kind of person who likes to sit in front of a terminal and watch a process making progress (and, really, who isn\u2019t?) you\u2019ll enjoy the <b>Watch Crawler Status<\/b> section.<\/p>\n<p>Navigate to <b>WP-Admin &gt; LiteSpeed Cache &gt; Crawler &gt; Summary<\/b>.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-12123\" src=\"https:\/\/lswp.store\/wp-content\/uploads\/2017\/06\/crawler-cron-updated.png\" alt=\"LSCache Crawler Cron\" width=\"1019\" height=\"340\" srcset=\"https:\/\/lswp.store\/wp-content\/uploads\/2017\/06\/crawler-cron-updated.png 1019w, https:\/\/lswp.store\/wp-content\/uploads\/2017\/06\/crawler-cron-updated-300x100.png 300w, https:\/\/lswp.store\/wp-content\/uploads\/2017\/06\/crawler-cron-updated-768x256.png 768w, https:\/\/lswp.store\/wp-content\/uploads\/2017\/06\/crawler-cron-updated-600x200.png 600w\" sizes=\"(max-width: 1019px) 100vw, 1019px\" \/><\/p>\n<p>If the crawler isn\u2019t actually running right now, make sure you set <b>Crawler<\/b> to <code>ON<\/code> on the previous screen, and that one or more of the crawlers listed on this page have <strong>Activate<\/strong> set to <code>ON<\/code>. If a crawler is not currently running, you can press the <b>Manually run<\/b> button.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-large wp-image-12125\" src=\"https:\/\/lswp.store\/wp-content\/uploads\/2017\/06\/crawler-watch-updated-1024x281.png\" alt=\"LSCWP Watch the Crawler\" width=\"1024\" height=\"281\" srcset=\"https:\/\/lswp.store\/wp-content\/uploads\/2017\/06\/crawler-watch-updated-1024x281.png 1024w, https:\/\/lswp.store\/wp-content\/uploads\/2017\/06\/crawler-watch-updated-300x82.png 300w, https:\/\/lswp.store\/wp-content\/uploads\/2017\/06\/crawler-watch-updated-768x211.png 768w, https:\/\/lswp.store\/wp-content\/uploads\/2017\/06\/crawler-watch-updated-600x164.png 600w, https:\/\/lswp.store\/wp-content\/uploads\/2017\/06\/crawler-watch-updated.png 1120w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/p>\n<p>Look at it go!<\/p>\n<h2>Impacts on Shared Hosting<\/h2>\n<p>Site owners love the crawler functionality, but if you are a shared hosting provider, chances are your first thought goes to the impact all of this crawling could have on your servers. Despite the fact that we\u2019ve provided several features designed to minimize a crawler\u2019s impact on the server, it&#8217;s a valid concern when you are hosting thousands of installations. This is why we have ultimately put crawler control into the hands of the hosts.<\/p>\n<p><b>LiteSpeed Web Server disables crawling by default<\/b>. This will keep usage restricted to those who truly want to use it. As host, it is your choice whether to enable crawler functionality at all. You can keep it permanently-disabled on a server-wide basis, if you do not want crawling on your system.<\/p>\n<p>When crawling is disabled, site administrators will see the following message in <b>WP Admin &gt; LiteSpeed Cache -&gt; Crawler<\/b><\/p>\n<pre>Warning: The crawler feature is not enabled on the LiteSpeed server. Please consult your server admin or hosting provider.<\/pre>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-12127 size-large\" src=\"https:\/\/lswp.store\/wp-content\/uploads\/2017\/06\/crawler-off-updated-1024x313.png\" alt=\"LSCWP Crawler Disabled\" width=\"1024\" height=\"313\" srcset=\"https:\/\/lswp.store\/wp-content\/uploads\/2017\/06\/crawler-off-updated-1024x313.png 1024w, https:\/\/lswp.store\/wp-content\/uploads\/2017\/06\/crawler-off-updated-300x92.png 300w, https:\/\/lswp.store\/wp-content\/uploads\/2017\/06\/crawler-off-updated-768x235.png 768w, https:\/\/lswp.store\/wp-content\/uploads\/2017\/06\/crawler-off-updated-600x184.png 600w, https:\/\/lswp.store\/wp-content\/uploads\/2017\/06\/crawler-off-updated.png 1062w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/p>\n<h3>How to Enable the Crawler<\/h3>\n<p><b>NOTE: we do not recommend crawler usage for shared hosting setups unless the server has enough capacity to handle it!<\/b><\/p>\n<p>There are a few different approaches you can take to crawling on your LiteSpeed Web Server:<\/p>\n<ul>\n<li>Disable it for the entire server<\/li>\n<li>Enable it for the entire server<\/li>\n<li>Selectively enable it for particular clients, while leaving it disabled for everyone else<\/li>\n<\/ul>\n<h4>Disable Crawling for the Entire Server<\/h4>\n<p>Do nothing. LiteSpeed Web Server disables crawling by default.<\/p>\n<h4>Enable Crawling for the Entire Server<\/h4>\n<p>You need to update the appropriate configuration file, like you did <span style=\"font-weight: 400;\">when you originally <\/span><a href=\"https:\/\/docs.litespeedtech.com\/lscache\/start\/#configure-cache-root-and-cache-policy\">set up your cache root<\/a>. Add the following:<\/p>\n<pre>&lt;IfModule LiteSpeed&gt;\n \u00a0CacheEngine on crawler\n&lt;\/IfModule&gt;<\/pre>\n<h4>Selectively Enable Crawling<\/h4>\n<p>To enable crawling for select clients, you would not update the server\u2019s config file. Instead, locate (or create) the virtual host include files for those clients and add the above lines to that.<\/p>\n<p>The exact location of the relevant configuration or include file varies, depending on the control panel you use (or if you use no control panel at all), and which of the above options you are looking to enact. For detailed instructions, please see <a href=\"https:\/\/docs.litespeedtech.com\/lscache\/lscwp\/admin\/#enabling-and-limiting-the-crawler\">our documentation on the subject<\/a>.<\/p>\n<p>If you don&#8217;t have access to the appropriate files, you will need to ask your server administrator to enable the crawler for you.<\/p>\n<h2>Update It!<\/h2>\n<p><a href=\"https:\/\/wordpress.org\/plugins\/litespeed-cache\/\">LiteSpeed Cache for WordPress<\/a>\u2019s crawler functionality is pretty handy, don&#8217;t you think? By regularly renewing the cache, you minimize the number of times your users have to wait for WordPress to process dynamic pages, and you speed up your whole site!<\/p>\n<p>After you\u2019ve experienced your first crawl, come back here and let us know what you think. We\u2019d love to get your feedback.<\/p>\n<p>P.S. There is more to this topic! If you want to get the most out of your crawler, take a look at these blog posts: <a href=\"https:\/\/lswp.store\/2018\/02\/14\/limiting-the-litespeed-cache-crawler-for-wordpress\/\">Limiting the Cache Crawler<\/a> and <a href=\"https:\/\/lswp.store\/2018\/12\/05\/managing-multiple-cache-crawlers-lscache\/\">Managing Multiple Cache Crawlers<\/a>.<\/p>\n<p>&#8212;<br \/>\nHave some of your own ideas for future <a href=\"http:\/\/blog.litespeedtech.com\/tag\/wordpress-wednesday\">WordPress Wednesday<\/a> topics? Leave us a comment!<\/p>\n<p>Don\u2019t forget to meet us back here next week for the next installment. In the meantime, here are a few other things you can do:<\/p>\n<ul>\n<li>Subscribe to the <a href=\"http:\/\/blog.litespeedtech.com\/tag\/wordpress-wednesday\/feed\/\">WordPress Wednesday RSS feed<\/a><\/li>\n<li>Download <a href=\"https:\/\/wordpress.org\/plugins\/litespeed-cache\/\">LiteSpeed Cache for WordPress plugin<\/a><\/li>\n<li>Learn more about the plugin <a href=\"https:\/\/www.litespeedtech.com\/products\/cache-plugins\/wordpress-acceleration\">on our website<\/a><\/li>\n<\/ul>\n<p>&#8212;<br \/>\n<em>This content was last verified and updated in March of 2022. If you find an inaccuracy, please let us know! In the meantime, see <a href=\"https:\/\/docs.litespeedtech.com\">our documentation site<\/a>\u00a0for the most up-to-date information.<\/em><\/p>\n","protected":false},"excerpt":{"rendered":"<p>LSCache for WP now has a crawler! Find out why it has the potential to make your WordPress site even faster.<\/p>\n","protected":false},"author":1,"featured_media":8150,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[28],"tags":[81,305,316,317],"class_list":["post-7203","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-cache","tag-crawler","tag-web-crawler","tag-wordpress","tag-wordpress-wednesday"],"jetpack_featured_media_url":"https:\/\/lswp.store\/wp-content\/uploads\/2017\/07\/wpw06.jpg","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/lswp.store\/index.php\/wp-json\/wp\/v2\/posts\/7203","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/lswp.store\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/lswp.store\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/lswp.store\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/lswp.store\/index.php\/wp-json\/wp\/v2\/comments?post=7203"}],"version-history":[{"count":0,"href":"https:\/\/lswp.store\/index.php\/wp-json\/wp\/v2\/posts\/7203\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/lswp.store\/index.php\/wp-json\/wp\/v2\/media\/8150"}],"wp:attachment":[{"href":"https:\/\/lswp.store\/index.php\/wp-json\/wp\/v2\/media?parent=7203"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/lswp.store\/index.php\/wp-json\/wp\/v2\/categories?post=7203"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/lswp.store\/index.php\/wp-json\/wp\/v2\/tags?post=7203"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}