helloworld12
V2EX  ›  问与答

前端有没有什么方案,可以下载压缩包,然后整个解压,使用里面的资源

  •  
  •   helloworld12 · Sep 5, 2018 · 2648 views
    This topic created in 2829 days ago, the information mentioned may be changed or developed.

    游戏开发,h5,出现,部分资源加载不全的问题 想要整个包下载,然后前端解压,再使用里面的资源,有什么方案吗?

    谢谢

    Supplement 1  ·  Sep 6, 2018
    目的不是压缩,是确保所有资源都打包到一起,防止有的资源没有下载下来
    7 replies    2018-09-06 03:41:08 +08:00
    imwalson
        1
    imwalson  
       Sep 5, 2018 via Android
    纯粹的 html 前端做不到;如果把 node.js 也算作前端,是可以的
    misaka19000
        3
    misaka19000  
       Sep 5, 2018
    gzip 还不够用吗?
    shiny
        4
    shiny  
    PRO
       Sep 5, 2018
    http/2 服务器推送试试?
    acthtml
        5
    acthtml  
       Sep 5, 2018
    js、css 通过 webpack 打包。
    其他资源没有想到什么方法。
    SilentDepth
        6
    SilentDepth  
       Sep 5, 2018
    JS 可以解压 zip,但解析里面的文件比较复杂,需要对应的解析库,比如 excel.js 之类的。通用的文件管理器,理论上似乎能做,但是现成的解决方案没见过。
    msg7086
        7
    msg7086  
       Sep 6, 2018
    HTTP 本来就会压缩吧。
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   5790 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 68ms · UTC 02:19 · PVG 10:19 · LAX 19:19 · JFK 22:19
    ♥ Do have faith in what you're doing.