Is it better to use Cache or CDN?

前端 未结 5 1615
忘掉有多难
忘掉有多难 2020-12-22 21:26

I was studying about browser performance when loading static files and this doubt has come.

Some people say that use CDN static files (i.e. Google Cod

5条回答
  •  醉话见心
    2020-12-22 22:13

    Agree with @Anthony_Hatzopoulos (+1)

    CDN compliments Caching, also in some cases it will help optimize Caching directives.

    For example, a company I work for integrated behavior learning algorithms into its CDN to identify and Cache dynamically generated objects.

    Ordinarily these object would be un-Cachable (i.e. [Cache-Control: max-age=0] Http header) but in this case the system is able to identify Caching possibilities and override original HTTP Header directions. (for example: a Dynamically generated popular product that should be Cached or popular Search result page that, while being generated dynamically, is still presented time over time in the same form to thousands of users).

    And yes, before you ask, the system can also identify personalized data and very freshness, to prevent false positives... :)

    Implementing such an algorithm was only possible due to a reverse proxy CDN technology and this is an example of how CDN and Caching can complement each other to create a better and smarter acceleration solutions.

提交回复
热议问题