Differences
This shows you the differences between two versions of the page.
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] 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 URLs. In this case, there is no such one cache copy to serve a lot of requests, instead, there will be generated thousands of cache copies. Literally, it means the site is not being served from cache. It will create a 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 displayed, they cannot be [[litespeed_wiki:cache:drop_query_string|simply ignored]], unfortunately. So, essentially, every single request for ''example.com'' would result in a 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. |