Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

'release folder' is too huge for webgl to work

Discussion in 'Web' started by kscho, Apr 18, 2015.

  1. kscho

    kscho

    Joined:
    Jun 17, 2014
    Posts:
    59
    I've been trying to get webgl's compressed folder to work but failed.

    To enable fast testing, I created a simple project with just some primitives in it.

    The webgl exports produces an index.html, a .htcaccess, and three folders: Compressed, Release and TemplateData.

    I moved every thing except the huge Release folder to Dropbox's Public folder to run the game remotely - it didn't work.

    If I moved the Release folder over too, it work. The issue is that the release folder is HUGE.

    What did I do wrong? How can I get a webgl package that's almost the same size as the webplayer export?
     
  2. liortal

    liortal

    Joined:
    Oct 17, 2012
    Posts:
    3,562
    I don't think you can run it on Dropbox and use the compressed folder, as u would need a web server for that.

    What we did was run a local NGINX server (http://nginx.org/) and used it to "locally host" our game. This cuts on the time needed to upload the game to Dropbox/Amazon S3/any other hosting service.

    Note that we do not use .htaccess and so we need to manually copy around some stuff (that is what the .htaccess does automatically by itself).

    If that is something you think would be of use and interesting to you, I may put up a blog post on this on my site (how to configure a local web server for testing WebGL builds).
     
    kscho likes this.
  3. kscho

    kscho

    Joined:
    Jun 17, 2014
    Posts:
    59
    hi liortal, thank you for your reply.

    I've set up a wamp server to test locally. Without the Release folder, my game works correctly. I think wamp is similar to your NGINX server, correct?

    Based on what u said, I wonder whether sites like kongregate and newgrounds are able to recognize .htaccess or not.

    If they don't recognize, what can I do in terms of 'manually copy some stuff'?

    Thank you for your advice.
     
  4. kscho

    kscho

    Joined:
    Jun 17, 2014
    Posts:
    59
    I just confirmed that kongregate and newgrounds are UNABLE to recognize .htaccess. bummer.
     
  5. De-Panther

    De-Panther

    Joined:
    Dec 27, 2009
    Posts:
    589
    It's not if they recognize .htaccess, maybe they have their own way to gzip the folder
     
  6. kscho

    kscho

    Joined:
    Jun 17, 2014
    Posts:
    59
    haiz ... Unity's webgl export is just a huge headache. I need a step-by-step guide on how to convert Unity's webgl export to something acceptable to Kongregate, indieDB and Newgrounds ...
     
  7. liortal

    liortal

    Joined:
    Oct 17, 2012
    Posts:
    3,562
    I dont have any experience with IndieDB or Kongregate, sorry :( not sure how that works there.
     
    kscho likes this.
  8. kscho

    kscho

    Joined:
    Jun 17, 2014
    Posts:
    59
    no problem ... they are the biggest html5 sites out there ... need to pray for miracle lol ...
     
  9. kscho

    kscho

    Joined:
    Jun 17, 2014
    Posts:
    59
    hi, liortal, are you able to share how to 'manually copy some stuff' so that I can bypass the .htaccess to use only the Compressed folder? That would be worth a try too, I think.
     
  10. liortal

    liortal

    Joined:
    Oct 17, 2012
    Posts:
    3,562
    So, you get 2 folders - Release and Compressed.

    They contain the same files (with a slight change in file extensions, e.g: .js turns into .jsgz to mark it as "gzip").
    The .htaccess file contains some rules that some web servers understand. For example, it says - "if the web server supports gzip, then instead of serving the files from Release, which are huge, do some kind of redirection and send out the stuff from Compressed".

    Again, i am not 100% sure if what we did would work for you with Kongregate, but what we did was this:

    1. Delete the "Release folder"
    2. Rename Compressed -> Release
    3. Remove gz from file extensions in that folder (e.g: .jsgz turns into .js, .memgz -> .mem)
    Again, not sure that would work for you as i dont know how you upload the files there, what server they use and whether it supports gzip or not.

    Thanks
    Lior
     
    kscho and De-Panther like this.
  11. De-Panther

    De-Panther

    Joined:
    Dec 27, 2009
    Posts:
    589
    We not only renamed the names of those files, we also set their headers to send "content-encoding" as "gzip"
     
    kscho likes this.
  12. kscho

    kscho

    Joined:
    Jun 17, 2014
    Posts:
    59
    thanks for your detailed explanation and instruction, lior. I just confirmed that the method doesnt' work on wamp and the various html5 portals, so another approach would be necessary.
     
  13. kscho

    kscho

    Joined:
    Jun 17, 2014
    Posts:
    59
    hi panther, mind elaborating on this? like you say 'their headers' - the headers of which files? we can't simply change a gzip file, can we?