• 请不要在回答技术问题时复制粘贴 AI 生成的内容
apple2026
V2EX  ›  程序员

请问 html 添加 icon 导致页面请求两次如果避免呢?

  •  
  •   apple2026 · Apr 17, 2022 · 2234 views
    This topic created in 1662 days ago, the information mentioned may be changed or developed.
     <link rel="shortcut icon" href="/resource/image/favicon.ico" type="image/png"/>
    

    就加了这段代码

    5 replies  •  2022-04-17 19:48:27 +08:00
    Chism
    Chism
    Apr 17, 2022 via Android
    2
    我直接服务端忽略 /favicon.ico 的请求
    不知道你说的是不是这个意思
    apple2026
    apple2026
    OP
    Apr 17, 2022 via iPhone
    3
    @Chism 嗯,我还是直接返回不处理。
    yimity
    yimity
    Apr 17, 2022
    4
    请求两次是不是你这个资源 404 了,然后 404 又返回的的网站首页啥的。
    IvanLi127
    IvanLi127
    Apr 17, 2022 via Android
    5
    我有个问题,你的 favicon.ico 的 type 为啥是 image/png ?
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Privacy   ·   Solana   ·   5063 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 38ms · UTC 07:11 · PVG 15:11 · LAX 23:11 · JFK 02:11
    ♥ Do have faith in what you're doing.