kaiki
V2EX  ›  问与答

想写网页游戏,但是要加载的资源比较多,有什么成熟的缓存方案吗

  •  
  •   kaiki · Jul 18, 2020 · 1655 views
    This topic created in 2136 days ago, the information mentioned may be changed or developed.
    图片资源就不说了,主要是游戏的道具数据,打算用 json 格式,但是要关联的 json 比较多,比如装备是一个 json,装备的套装又是一个,装备的强化属性也得单独获取,想加载一个装备就得获取好几个。
    除了强化这种是动态的,其他的基本是静态资源,如果是端游就可以直接写在客户端中,但是页游就不知道怎么办了,有什么好办法或者案例吗?

    第一次写页游,没什么经验。
    4 replies    2020-07-18 15:46:55 +08:00
    yuzo555
        1
    yuzo555  
       Jul 18, 2020
    IndexedDB ?
    yuzo555
        2
    yuzo555  
       Jul 18, 2020
    IndexedDB 比较成熟的项目是 localForage
    AreYou0k
        3
    AreYou0k  
       Jul 18, 2020
    ServiceWorker 可以试试
    ysc3839
        4
    ysc3839  
       Jul 18, 2020 via Android
    为什么要分单独的文件?写进 js 里面不行吗?
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   1294 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 34ms · UTC 17:11 · PVG 01:11 · LAX 10:11 · JFK 13:11
    ♥ Do have faith in what you're doing.