This shows you the differences between two versions of the page.

Link to this comparison view

litespeed_wiki:cache:site-non-suitable-for-cache [2018/06/14 19:58]
Jackson Zhang created
litespeed_wiki:cache:site-non-suitable-for-cache [2018/06/14 20:37] (current)
Lisa Clarke Proofreading
Line 1: Line 1:
-====== ​Cache may not help some site such as ads site ======+====== ​Caching is Not Always Appropriate ​======
-The cache can generally help with most of the sites and situations, but for some certain situation, ​for example, ads site, the cache may not help.+The cache can generally help with most sites and situations, but there are some types of sites for which caching is just not suitable. For example, ​an ads site.
-**ads site** ​normally ​runs some customized PHP script.  Most of the time, the ads site will use different ​unique query strings for each request. ​ Each request with different ​query strings will be treated as different ​URLsIn this casethere is no such one cache copy to serve a lot of requestsinstead, there will be generated thousands of cache copiesLiterallyit means the site is not being served from cacheIt will create ​disk problem whiling caching such thousands ​of requests. We do see millions of files have been created and taking some 300GB space very quickly.+Ad sites normally ​run customized PHP script ​which use unique query strings for each request. ​''​example.com?​query=ABC''​ is considered a different ​URL than ''​example.com?​query=DEF''​even though they are both technically ''​example.com''​. Because the query strings actually have an effect on the content displayedthey cannot ​be [[litespeed_wiki:​cache:​drop_query_string|simply ignored]], unfortunatelySoessentially,​ every single request for ''​example.com''​ would result in separate cached entry because ​of its unique query string.
-For such site, we recommend:+This has two effects: 
 +  - No visitor is ever served from cache, because each unique URL is a cache miss. 
 +  - The disk is filling up with thousands of generated copies of the same page, but is never serving any of them to anyone.
-  * You should not enable cache for it globally. +Our support team has seen this occur on a site with millions of versions of the page cached and 300GB of space quickly filled up.
-  * Another recommendation is, instead of turning ​on cache globally, you should selectively to choose ​the pages can be cached and setup cache with rewrite rules. for example, For whole page cache without ESI, dropping tracking-related query string is safe to do+
-If you experience such cache disk issue, you can try [[litespeed_wiki:​cache:​no-plugin-setup-guidline#​deleting_outdated_cache_files_through_linux_command_using_a_cron_job|some cron job]] to remove outdated cache files regularly. ​+For sites like these we recommend:​ 
 +  * Do not enable cache globally for the site 
 +  * Selectively choose the pages on the site that may be cached, and [[litespeed_wiki:​cache:​no-plugin-setup-guidline#​understand_cacheenable_cachedisable_cachelookup_directives_and_rewrite_rules|configure them via rewrite rules]]. 
 +If your cache disk is filling up fast, you can try  [[litespeed_wiki:​cache:​no-plugin-setup-guidline#​deleting_outdated_cache_files_through_linux_command_using_a_cron_job|using a cron job]] to remove outdated cache files regularly. ​
litespeed_wiki/cache/site-non-suitable-for-cache.txt · Last modified: 2018/06/14 20:37 by Lisa Clarke