In Global Config in joomla have 2 caching is conservative and progressive, what is difference both ?
在Joomla的Global Config中有2个缓存是保守和渐进的,两者有什么区别?
3 个解决方案
#1
30
Conservative caching is the standard type of caching. Here’s how it works:
保守缓存是缓存的标准类型。以下是它的工作原理:
A visitor visits a page on your website.
访问者访问您网站上的页面。
Joomla checks if there is a non-expired version of that page in its cache directory.
Joomla检查其缓存目录中是否存在该页面的非过期版本。
- If the cached page exists (and it’s not expired), then Joomla will serve it to the visitor – otherwise, a cached version of the page is created, and that cached version will be served to the visitor, and to every other consequent visitor, as long as it’s (by “it” we mean the page) not expired.
- 如果缓存页面存在(并且它未过期),则Joomla会将其提供给访问者 - 否则,将创建页面的缓存版本,并且缓存版本将提供给访问者以及其他所有后续访问者,只要它(由“它”表示页面)未过期。
The above scenario is typical and is how most developers implement caching.
上面的场景是典型的,是大多数开发人员实现缓存的方式。
Progressive caching works the following way:
渐进式缓存以下列方式工作:
A visitor visits a page on your website.
访问者访问您网站上的页面。
Joomla checks if a cached version of that page exists for that visitor and it’s not yet expired.
Joomla会检查该访问者是否存在该页面的缓存版本,但该版本尚未过期。
If that cached page exists, then it’ll be served to the visitor, otherwise, Joomla will create the cached page for that specific visitor and then will serve it to him.
如果该缓存页面存在,那么它将被提供给访问者,否则,Joomla将为该特定访问者创建缓存页面,然后将其提供给他。
If another visitor (who has never been on that page) visits that page, then Joomla will not serve the cached page of the previous visitor, instead, it will create a cached version of that page
specifically for that user, and then serves it to him.如果另一个访问者(从未访问过该页面)访问该页面,那么Joomla将不会为前一个访问者的缓存页面提供服务,相反,它将专门为该用户创建该页面的缓存版本,然后将其提供给他。
As you can see, progressive caching only offers a performance improvement if the same visitor visits the same page within the lifetime of the cached version of the page. In most scenarios, progressive caching results in a huge performance hit that is far worse than disabling cache, simply because for nearly every visit, Joomla has to process the request, create the cached version of the page, and then serve the page to the visitor (instead of just processing the request and serving the page in the scenario where cache is disabled). Oh, and don’t forget about all the cache files generated by Joomla – you can only imagine how many of these files you will have in your cache folder if you have a high traffic news website (that has many pages).
如您所见,如果同一访问者在页面缓存版本的生命周期内访问同一页面,则渐进式缓存仅提供性能改进。在大多数情况下,渐进式缓存会导致巨大的性能损失远远超过禁用缓存,因为几乎每次访问时,Joomla都必须处理请求,创建页面的缓存版本,然后将页面提供给访问者(而不是仅仅在禁用缓存的情况下处理请求和提供页面)。哦,不要忘记Joomla生成的所有缓存文件 - 如果你有一个高流量新闻网站(有很多页面),你只能想象你的缓存文件夹中有多少这些文件。
Now you might wonder, under which circumstances is progressive caching useful? Well, imagine that you have a video website (similar to youtube). You want to show each visitor customized pages based on his location and/or browser settings and/or plugins installed. So, for every page that the visitors loads, you use this information to generate a customized version of that page and you cache it. If the visitor visits that same page again, then Joomla doesn’t need to redo the work to generate the customized page.
现在您可能想知道,在哪种情况下渐进式缓存有用吗?好吧,想象一下你有一个视频网站(类似于youtube)。您希望根据其位置和/或浏览器设置和/或安装的插件显示每个访客自定义页面。因此,对于访问者加载的每个页面,您都可以使用此信息生成该页面的自定义版本并对其进行缓存。如果访问者再次访问同一页面,则Joomla不需要重做工作来生成自定义页面。
Of course, there are many scenarios under which progressive caching is really useful, but in our opinion, progressive caching should only be considered if the website receives many visitors and if those visitors are mostly repeat visitors. Using it in other cases will cause a significant hit on the website’s performance.
当然,在许多场景下,渐进式缓存非常有用,但在我们看来,只有在网站收到许多访问者并且这些访问者大多是重复访问者时才应考虑渐进式缓存。在其他情况下使用它将对网站的性能造成重大打击。
Extracted from here.
从这里提取。
#2
11
For Unique cache per visitor
对于每位访客的唯一缓存
-
Conservative cache shows all visitors to your site the same exact cached content.
保守缓存向您网站的所有访问者显示相同的缓存内容。
-
Progressive caching however caches the content for each user uniquely.
然而,渐进式缓存唯一地为每个用户缓存内容。
From the link Provided by @Tornado's comment
来自@ Tornado评论提供的链接
#3
1
Progressive caching works just like conservative caching with a difference that buffers are updated progressively.
渐进式缓存就像保守缓存一样,不同之处在于缓冲区会逐步更新。
If you look at the render function in JApplicationCMS (where progressive caching is set), you will find that its not applicable to logged in users. https://github.com/joomla/joomla-cms/blob/staging/libraries/cms/application/cms.php
如果查看JApplicationCMS中的render函数(设置了渐进式缓存),您会发现它不适用于登录用户。 https://github.com/joomla/joomla-cms/blob/staging/libraries/cms/application/cms.php
if ($this->isSite() && $this->get('caching') && $this->get('caching', 2) == 2 && !JFactory::getUser()->get('id'))
{
$caching = true;
}
Further if you dump the cache id's for the same page across browsers or ips you will get the same cache id's.
此外,如果您跨浏览器或ips转储同一页面的缓存ID,您将获得相同的缓存ID。
The typical work of progressive caching happens in JCache's getWorkarounds and setWorkarounds. However beware, the cbuffers can get unwieldy large at times causing issues.
渐进式缓存的典型工作发生在JCache的getWorkarounds和setWorkarounds中。但要注意,cbuffers可能会变得笨重,有时会导致问题。
#1
30
Conservative caching is the standard type of caching. Here’s how it works:
保守缓存是缓存的标准类型。以下是它的工作原理:
A visitor visits a page on your website.
访问者访问您网站上的页面。
Joomla checks if there is a non-expired version of that page in its cache directory.
Joomla检查其缓存目录中是否存在该页面的非过期版本。
- If the cached page exists (and it’s not expired), then Joomla will serve it to the visitor – otherwise, a cached version of the page is created, and that cached version will be served to the visitor, and to every other consequent visitor, as long as it’s (by “it” we mean the page) not expired.
- 如果缓存页面存在(并且它未过期),则Joomla会将其提供给访问者 - 否则,将创建页面的缓存版本,并且缓存版本将提供给访问者以及其他所有后续访问者,只要它(由“它”表示页面)未过期。
The above scenario is typical and is how most developers implement caching.
上面的场景是典型的,是大多数开发人员实现缓存的方式。
Progressive caching works the following way:
渐进式缓存以下列方式工作:
A visitor visits a page on your website.
访问者访问您网站上的页面。
Joomla checks if a cached version of that page exists for that visitor and it’s not yet expired.
Joomla会检查该访问者是否存在该页面的缓存版本,但该版本尚未过期。
If that cached page exists, then it’ll be served to the visitor, otherwise, Joomla will create the cached page for that specific visitor and then will serve it to him.
如果该缓存页面存在,那么它将被提供给访问者,否则,Joomla将为该特定访问者创建缓存页面,然后将其提供给他。
If another visitor (who has never been on that page) visits that page, then Joomla will not serve the cached page of the previous visitor, instead, it will create a cached version of that page
specifically for that user, and then serves it to him.如果另一个访问者(从未访问过该页面)访问该页面,那么Joomla将不会为前一个访问者的缓存页面提供服务,相反,它将专门为该用户创建该页面的缓存版本,然后将其提供给他。
As you can see, progressive caching only offers a performance improvement if the same visitor visits the same page within the lifetime of the cached version of the page. In most scenarios, progressive caching results in a huge performance hit that is far worse than disabling cache, simply because for nearly every visit, Joomla has to process the request, create the cached version of the page, and then serve the page to the visitor (instead of just processing the request and serving the page in the scenario where cache is disabled). Oh, and don’t forget about all the cache files generated by Joomla – you can only imagine how many of these files you will have in your cache folder if you have a high traffic news website (that has many pages).
如您所见,如果同一访问者在页面缓存版本的生命周期内访问同一页面,则渐进式缓存仅提供性能改进。在大多数情况下,渐进式缓存会导致巨大的性能损失远远超过禁用缓存,因为几乎每次访问时,Joomla都必须处理请求,创建页面的缓存版本,然后将页面提供给访问者(而不是仅仅在禁用缓存的情况下处理请求和提供页面)。哦,不要忘记Joomla生成的所有缓存文件 - 如果你有一个高流量新闻网站(有很多页面),你只能想象你的缓存文件夹中有多少这些文件。
Now you might wonder, under which circumstances is progressive caching useful? Well, imagine that you have a video website (similar to youtube). You want to show each visitor customized pages based on his location and/or browser settings and/or plugins installed. So, for every page that the visitors loads, you use this information to generate a customized version of that page and you cache it. If the visitor visits that same page again, then Joomla doesn’t need to redo the work to generate the customized page.
现在您可能想知道,在哪种情况下渐进式缓存有用吗?好吧,想象一下你有一个视频网站(类似于youtube)。您希望根据其位置和/或浏览器设置和/或安装的插件显示每个访客自定义页面。因此,对于访问者加载的每个页面,您都可以使用此信息生成该页面的自定义版本并对其进行缓存。如果访问者再次访问同一页面,则Joomla不需要重做工作来生成自定义页面。
Of course, there are many scenarios under which progressive caching is really useful, but in our opinion, progressive caching should only be considered if the website receives many visitors and if those visitors are mostly repeat visitors. Using it in other cases will cause a significant hit on the website’s performance.
当然,在许多场景下,渐进式缓存非常有用,但在我们看来,只有在网站收到许多访问者并且这些访问者大多是重复访问者时才应考虑渐进式缓存。在其他情况下使用它将对网站的性能造成重大打击。
Extracted from here.
从这里提取。
#2
11
For Unique cache per visitor
对于每位访客的唯一缓存
-
Conservative cache shows all visitors to your site the same exact cached content.
保守缓存向您网站的所有访问者显示相同的缓存内容。
-
Progressive caching however caches the content for each user uniquely.
然而,渐进式缓存唯一地为每个用户缓存内容。
From the link Provided by @Tornado's comment
来自@ Tornado评论提供的链接
#3
1
Progressive caching works just like conservative caching with a difference that buffers are updated progressively.
渐进式缓存就像保守缓存一样,不同之处在于缓冲区会逐步更新。
If you look at the render function in JApplicationCMS (where progressive caching is set), you will find that its not applicable to logged in users. https://github.com/joomla/joomla-cms/blob/staging/libraries/cms/application/cms.php
如果查看JApplicationCMS中的render函数(设置了渐进式缓存),您会发现它不适用于登录用户。 https://github.com/joomla/joomla-cms/blob/staging/libraries/cms/application/cms.php
if ($this->isSite() && $this->get('caching') && $this->get('caching', 2) == 2 && !JFactory::getUser()->get('id'))
{
$caching = true;
}
Further if you dump the cache id's for the same page across browsers or ips you will get the same cache id's.
此外,如果您跨浏览器或ips转储同一页面的缓存ID,您将获得相同的缓存ID。
The typical work of progressive caching happens in JCache's getWorkarounds and setWorkarounds. However beware, the cbuffers can get unwieldy large at times causing issues.
渐进式缓存的典型工作发生在JCache的getWorkarounds和setWorkarounds中。但要注意,cbuffers可能会变得笨重,有时会导致问题。