muyege
V2EX  ›  问与答

页面中 http 请求太多了,应该怎么优化一下呢?

  •  
  •   muyege · Jun 22, 2016 · 3508 views
    This topic created in 3701 days ago, the information mentioned may be changed or developed.

    RT,虽然最后访问各数据接口拿到数据后生成的是静态页面,用户访问不会慢,但是生成的时候真心慢啊,各种接口,各种 HTTP 请求,求各路大神,这种情况怎么优化呢?

    6 replies    2016-06-22 23:48:33 +08:00
    Felldeadbird
        1
    Felldeadbird  
       Jun 22, 2016
    要么合并请求,要么做 异步加载。
    fcicq
        2
    fcicq  
       Jun 22, 2016
    现在的页面就是要调用大量的后端服务才能构建出来啊. 然后楼主就开始研究 RPC 去了.
    qiayue
        3
    qiayue  
       Jun 22, 2016
    能缓存结果的接口就缓存
    jookr
        4
    jookr  
       Jun 22, 2016
    html5 localstorage
    chairuosen
        5
    chairuosen  
       Jun 22, 2016
    web 服务机器和 api 机器放一个内网,然后 api 加缓存
    jookr
        6
    jookr  
       Jun 22, 2016 via iPhone
    @chairuosen 第一次听说这个方法 求关键指教关键的几个代码或者例子 先谢谢了
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   5596 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 32ms · UTC 06:30 · PVG 14:30 · LAX 23:30 · JFK 02:30
    ♥ Do have faith in what you're doing.