Home  >  Q&A  >  body text

nginx - Is it possible to use server 301 redirection to create static file CDN?

For example, the static file access address of a normal website is: abc.com/static/logo.png Can this file address be changed to baidu.com/static/logo.png through server 301 redirection? This avoids downloading static files directly from the abc.com server and instead downloads them from the baidu.com website

phpcn_u1582phpcn_u15822713 days ago488

reply all(3)I'll reply

  • 大家讲道理

    大家讲道理2017-05-16 17:06:08

    Of course you can, but with one more redirect, apart from saving some server traffic, I’m afraid it won’t improve the user experience.
    Because the time consumption is mainly in establishing the connection with the new server, it does not take much time to transfer the data.

    For your example, I suggest that the static files from baidu.com be directly quoted in the page.

    reply
    0
  • 仅有的幸福

    仅有的幸福2017-05-16 17:06:08

    Yes, image static resources support 301 these

    reply
    0
  • 漂亮男人

    漂亮男人2017-05-16 17:06:08

    Yes, this can be used to improve the access experience of overseas websites
    Such as hostker

    reply
    0
  • Cancelreply