c:set从页面缓存中取值_通过缓存提高页面传送速度:简介

c:set从页面缓存中取值

A growing audience places greater demands on site performance: 20 casual visitors a day is a very different animal from thousands of people hitting your site every hour. There are many possible ways to adapt to the demands of increased traffic:

越来越多的观众对网站的性能提出了更高的要求:每天有20个临时访问者与每小时数千名访问您网站的人完全不同。 有多种可能的方法来适应不断增长的流量需求:

  • Optimising and compressing site resources: most especially images, but also HTML, CSS and JavaScript.

    优化和压缩站点资源: 最特别是图像 ,还有HTMLCSS和JavaScript。

  • Writing more efficient database queries.

    编写更有效的数据库查询。
  • Caching site resources.

    缓存站点资源。
  • Utilizing a Content Delivery Network.

    利用内容交付网络。
  • Upgrading hosting services and servers.

    升级托管服务和服务器。

The first three are usually the cheapest options, yielding the greatest bang for your buck, although they can make some time and work to apply. The last two options are usually fast to apply and very effective, but come with long-term expense in the form of increased monthly fees from your hosting provider and CDN.

前三个通常是最便宜的选择,尽管您可以花一些时间和精力来申请,但它们却能为您带来最大的收益。 最后两个选项通常可以快速应用且非常有效,但是会带来长期费用,其形式是托管提供商和CDN会增加月租费用。

Caching is complicated by the fact that there are at least three different ways the content of your site can be cached:

至少有三种不同的方式可以缓存网站内容的事实使缓存变得复杂:

  • Local caching, whereby the browser stores information downloaded from a site locally, and refers to it during subsequent visits rather than reloading the original data stored on the server. All browsers do this naturally to some degree, some more aggressively than others. You can control local caching behavior for every browser, directing what is stored and for how long, to further benefit for your site.

    本地缓存 ,即浏览器在本地缓存中存储从站点下载的信息,并在后续访问期间引用该信息,而不是重新加载存储在服务器上的原始数据。 所有浏览器都会在某种程度上自然地执行此操作,某些浏览器会比其他浏览器更主动。 您可以控制每个浏览器的本地缓存行为,控制存储内容和存储时间,以使您的站点进一步受益。

  • Server-side caching, in which a static copy is made of a dynamic page. This copy is served to the user, rather than assembling a fresh page for every visitor.

    服务器端缓存 ,其中静态副本由动态页面组成。 该副本将提供给用户,而不是为每个访问者组装一个新页面。

  • Caching on a CDN, where copies of site resources are distributed across servers to achieve faster delivery times in response to requests.

    在CDN上进行缓存,在该CDN上站点资源的副本分布在服务器之间,以响应请求而缩短交付时间。

As CDN caching techniques differ slightly from one Content Delivery Network to another, I’ll concentrate on just the first two variations in the series to come.

由于CDN缓存技术在一个内容交付网络与另一个内容交付网络之间略有不同,因此,我将仅关注系列中的前两个变化。

Caching can deliver significant speed benefits to a site, but comes with a cost: once published, it is assumed that site assets will very rarely change, or not at all. Maintaining a site under such conditions can be a trying experience: you are literally fighting the memory of the site, a memory potentially stored in at least three different locations. For this reason, I'll address “cache-busting” techniques at the end of this series, detailing ways of alerting local and server-side caches that new content is available and should be reflected in the browser, rather than drawing the old version from the cache.

缓存可以为站点带来显着的速度优势,但是却要付出一定的代价:一旦发布,就假定站点资产很少或根本没有变化。 在这种情况下维护站点可能是一种尝试的体验:您实际上是在争夺站点的内存,该内存可能存储在至少三个不同的位置。 因此,在本系列文章的结尾,我将介绍“缓存清除”技术,详细介绍向本地和服务器端缓存发出警报的方法,这些新内容可用并且应该在浏览器中反映出来,而不是绘制旧版本。从缓存中。

翻译自: https://thenewcode.com/741/Increase-Page-Delivery-Speeds-with-Caching-Introduction

c:set从页面缓存中取值

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值