xinghai10086
V2EX  ›  问与答

添加了 cdn,导致无法获取用户设备信息问题。各位大神看过来

  •  
  •   xinghai10086 · Jul 28, 2018 · 1438 views
    This topic created in 2939 days ago, the information mentioned may be changed or developed.
    WEB\ H5 是 2 套系统,css \js 那些都不一样。分别添加了 cdn,手机端使用域名 m.xx.com,因为添加 cdn 的缘故,js,css 都缓存了,导致无法分辨出用户使用的是什么设备访问。
    之前是通过 nignx 了解到用户的访问设备,现在 cdn 添加了后,无法分辨用户的访问设备,用户要是使用手机端点击 www.xx.com 访问的话,就无法重定向到 m.xx.com 了。目前遇到的这种问题有没有好的解决方案。
    4 replies    2018-07-30 20:10:53 +08:00
    xinghai10086
        1
    xinghai10086  
    OP
       Jul 28, 2018
    各位大神看过来
    oonnnoo
        2
    oonnnoo  
       Jul 29, 2018 via Android
    通过 JS 判断设备,进行跳转
    xinghai10086
        3
    xinghai10086  
    OP
       Jul 29, 2018
    @oonnnoo 可是,js 已经缓存在 cdn 了,就无法判断了啊
    oonnnoo
        4
    oonnnoo  
       Jul 30, 2018 via Android
    @xinghai10086 通过 JS 在客户端判断呀~

    通过修改 js 文件名或添加时间戳,让网页重新加载新的 js
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   1159 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 30ms · UTC 18:07 · PVG 02:07 · LAX 11:07 · JFK 14:07
    ♥ Do have faith in what you're doing.