Long waiting (TTFB) time for scripts / styles on Azure Website

前端 未结 6 2370
小蘑菇
小蘑菇 2021-01-03 19:53

I have this intriguing problem on Azure Website. My website uses 4 script files and 3 style files, each minified. They are not so big, bigest has near 200 KBs. Website had a

6条回答
  •  心在旅途
    2021-01-03 20:21

    Although your static files are cached, the browser still issues requests with if-modifies-since header (which results in a 304).

    While it doesn't need to download the actual content, it still needs to wait the RTT + server think time to continue.

    I would suggest two things:

    1. Adding Cache-Control and Expire headers - will help avoid 304 in some cases (pretty much unless you hit F5)
    2. Using a proper CDN - such as Incapsula or others, that will minimize the RTT + think time. It can also be used to easily control cache settings for various resources.

    More good stuff here.

    Good Luck!

提交回复
热议问题