沃梦达 / 编程问答 / php问题 / 正文

joomla 2.5 中的保守缓存和渐进式缓存有什么区别?

What is difference between conservative caching and progressive caching in joomla 2.5?(joomla 2.5 中的保守缓存和渐进式缓存有什么区别?)

本文介绍了joomla 2.5 中的保守缓存和渐进式缓存有什么区别?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在joomla的全局配置中有2个缓存是保守的和渐进的,两者有什么区别?

In Global Config in joomla have 2 caching is conservative and progressive, what is difference both ?

推荐答案

保守缓存是标准的缓存类型.这是它的工作原理:

Conservative caching is the standard type of caching. Here’s how it works:

  • 访问者访问您网站上的页面.

  • A visitor visits a page on your website.

Joomla 检查其缓存目录中是否存在该页面的未过期版本.

Joomla checks if there is a non-expired version of that page in its cache directory.

以上场景是典型的,也是大多数开发者实现的方式缓存.

The above scenario is typical and is how most developers implement caching.

渐进式缓存的工作方式如下:

  • 访问者访问您网站上的页面.

  • A visitor visits a page on your website.

Joomla 检查该访问者是否存在该页面的缓存版本,并且该版本尚未过期.

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 必须处理请求,创建缓存版本的页面,然后将该页面提供给访问者(而不仅仅是在以下场景中处理请求并提供页面服务缓存被禁用).哦,不要忘记所有缓存文件由 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).

现在你可能想知道,在什么情况下是渐进式缓存有用?好吧,假设您有一个视频网站(类似于YouTube).您想向每个访问者显示基于他的自定义页面位置和/或浏览器设置和/或安装的插件.因此对于访问者加载的每个页面,您使用此信息生成该页面的自定义版本并缓存它.如果访问者再次访问同一页面,然后 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.

当然,渐进式缓存的场景有很多真的很有用,但在我们看来,渐进式缓存应该只是考虑网站是否有很多访问者,如果这些访问者主要是回头客.在其他情况下使用它会导致对网站性能造成重大影响.

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.

摘自此处.

这篇关于joomla 2.5 中的保守缓存和渐进式缓存有什么区别?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!

本文标题为:joomla 2.5 中的保守缓存和渐进式缓存有什么区别?

基础教程推荐