Search Unity

Data caching on Unity 5.6 is not working

Discussion in 'Web' started by XSUnity, Apr 27, 2017.

  1. XSUnity

    XSUnity

    Joined:
    Nov 18, 2012
    Posts:
    18
    Guys can you confirm that in deed Data caching on the new unity 5.6 (f3, p1 & p2) is not working.
    I've tried everything , and can not find a way to make it work
     
  2. Marco-Trivellato

    Marco-Trivellato

    Unity Technologies

    Joined:
    Jul 9, 2013
    Posts:
    1,654
    Which browser? Have you tried a different one?
     
  3. XSUnity

    XSUnity

    Joined:
    Nov 18, 2012
    Posts:
    18
    So far, we've tried Firefox & Chrome under Windows and Chrome & Safari under Mac.
    Tried with and without "Name files as hashes" - no effect.

    My other settings are :
    WEB GL Memory size - 400
    Compression - None
    Data caching - On
    Debug symbols - Off
    WebAssembly - Off

    I am using Unity 5.6 p2 on Windows for the build.
    Wast leek with the 5.5.2 p4, the cache was working with the same server and server settings
     
    Last edited: Apr 27, 2017
  4. Marco-Trivellato

    Marco-Trivellato

    Unity Technologies

    Joined:
    Jul 9, 2013
    Posts:
    1,654
    It might not matter but how big is your data file?
     
  5. XSUnity

    XSUnity

    Joined:
    Nov 18, 2012
    Posts:
    18
    xxxxx.data.unityweb - 66 mb
    xxxxx.asm.code.unityweb - 27.7 mb
     
  6. Marco-Trivellato

    Marco-Trivellato

    Unity Technologies

    Joined:
    Jul 9, 2013
    Posts:
    1,654
    Is the data file smaller with Unity 5.5? I am wondering if you are exceeding the browser's indexedDB size limits.
     
  7. XSUnity

    XSUnity

    Joined:
    Nov 18, 2012
    Posts:
    18
    They are about the same
    xxxx.data - 65.9 mb
    xxxx.asm.js - 26.7 mb
     
  8. Marco-Trivellato

    Marco-Trivellato

    Unity Technologies

    Joined:
    Jul 9, 2013
    Posts:
    1,654
    Could you also check whether you can find the file here: chrome://cache?
     
  9. XSUnity

    XSUnity

    Joined:
    Nov 18, 2012
    Posts:
    18
    So i update to the yesterday's patch 5.6.0 p3 - still no cache
    Let me show you the FF console :


    SOME TIMES the asm.* files are cached , but after a few page refreshes and and they are downloaded again

    As for the chrome, i've cleaned the browser cache and go to your link (witch was indeed empty) and them i open the game.
    At first i saw them (data and asm.js) in the cahce, but after they have finished loading , they disappeared from the cache list. Tried a second refresh on the game. Same thing. Saw them in the cache list and as soon they are loaded, they are removed from the list.
    I can see the assets bundle urls in the cache list , and they seams to work fine

    Any help will be appreciated
     
  10. mentolatux

    mentolatux

    Joined:
    Nov 2, 2014
    Posts:
    240
    it happen same to me , this is my Case 909706
     
  11. mentolatux

    mentolatux

    Joined:
    Nov 2, 2014
    Posts:
    240
    bro have you find the problem, have you fixed ? what windows use ? mine is Win 10
    also have you try to Cloud Build ¿?
     
  12. Kosmo42

    Kosmo42

    Joined:
    Apr 13, 2016
    Posts:
    1
    Hi, I've got the same problem on Unity 5.6.0f3(64-bit). Data file (.data.unityweb) is 53.5M and it's the only one in these files that is not cached. All other files are cached and is visible under chrome://cache.
    QQ浏览器截屏未命名.png I've searched on chrome settings, command line parameter --disk-cache-size=xxx is not working, and this article https://developer.chrome.com/apps/offline_storage#types talks about managing storage, but I'm not able to find a workable solution from this.
    Anyone got a solution, please let me know penghui.zhang@foxmail.com. Thanks!
     
  13. roka

    roka

    Joined:
    Sep 12, 2010
    Posts:
    598
    Well ,for me, it seem that chrome download everytime (i can see the file on chrome://cache/), but according the loading animation and console, it download it again.

    On firefox :

    With GZ off , so without :

    First load without gz :


    Second load without gz :


    The size is 6.07

    Now with GZ, so with :

    First load witht gz :


    Second load with gz :


    The size is 27.76 , (transfered 6.07 in the first load)

    It's normal ?

    Everything was fine with unity 5.5 on firefox and chrome, but with unity 5.6, caching seem to work only on firefox.

    Thank you.
     
  14. mentolatux

    mentolatux

    Joined:
    Nov 2, 2014
    Posts:
    240
    all version on unity 5.6 up no data catching , unity doesn't care about webgl , i move to unity 5.5.3
     
  15. XSUnity

    XSUnity

    Joined:
    Nov 18, 2012
    Posts:
    18
    Same here .... we went back to 5.5 because of the unity web gl cache bug.
    I've read every thread related to web gl + caching + unity 5.6, and the response from the unity team is -
    Your build size is too big, try using assets to reduce the size.

    Please tell me how the 66mb are cached when building with 5.5 and NOT CACHED with 5.6 ?
     
  16. roka

    roka

    Joined:
    Sep 12, 2010
    Posts:
    598
    For me, the problem is the new .unityweb extension.
     
  17. roka

    roka

    Joined:
    Sep 12, 2010
    Posts:
    598
    Also , they tell us to use to use the asset bundle and it sound logic but the asset bundle use more memory than a biger build. I have a difference of 50MB of memory by using or not the asset bundle and if we want to be below the 256MB in order to allow 32bit web browser to run our content, we must not use it for the big part of our game (generaly the main content).
     
  18. mentolatux

    mentolatux

    Joined:
    Nov 2, 2014
    Posts:
    240
    bro your game is awesome, how to optimize to player 14 players ?
     
  19. roka

    roka

    Joined:
    Sep 12, 2010
    Posts:
    598
    It has been a long process for me. A big review has been done on all scripts in order to call it only when needed, shader optimization,model optimization ect...
     
  20. mentolatux

    mentolatux

    Joined:
    Nov 2, 2014
    Posts:
    240
    i have 48 megabyte on my project and not data cached , i try also 5.6.1 and same problem, i try also on cloud build and same on all version from 5.6 up,
     
  21. ciorbyn

    ciorbyn

    Joined:
    Oct 17, 2013
    Posts:
    138
    I have the same problem on games of various sizes. The problem is that the MyGame.data.unityweb file is not saved. Or rather it is visible in the cache during the download phase, but when the game load is complete it seems to be deleted. Not even with 5.6.1 don't work. Each version of untiy has a new problem! I'm tired :mad:
     
    mentolatux likes this.
  22. XSUnity

    XSUnity

    Joined:
    Nov 18, 2012
    Posts:
    18

    You just confirm my observations.
     
  23. XSUnity

    XSUnity

    Joined:
    Nov 18, 2012
    Posts:
    18

    Please, tell us how to proceed ?
     
  24. ciorbyn

    ciorbyn

    Joined:
    Oct 17, 2013
    Posts:
    138
    In some cases, even in unity 5.5 the cache is not saved. The problem especially occurs on chrome (unfortunately the most used browser).

    Firefox works pretty well.

    I've tested several games built from 5.5 to 5.6.1f1, and almost no one saves the cache. As a result I lose many players who consequently do not return to the games.
     
  25. Marco-Trivellato

    Marco-Trivellato

    Unity Technologies

    Joined:
    Jul 9, 2013
    Posts:
    1,654
    Let me clarify the current situation on caching.
    • Up to Unity 5.5 we used to package the data file in a way that supported IndexedDB caching. So that even if the browser did not cache build.data by default, because it exceeded file size limits, the file would still be cached in IndexedDB.
    • This is no longer the case as of 5.6. We package it differently and we rely completely on browser caching at the moment.
    • We were not able to add IndexedDB caching for build.data.unityweb in time for 5.6 release, however this is something we are currently working on.
    • This does not affect asset bundle caching, in fact, you could move some of your assets to asset bundles so that your build.data.unityweb does not exceed the caching limits. This way both data file and asset bundle would be cached.
    As far as caching not working in 5.5 either, that's unexpected.
     
    ilmario likes this.
  26. roka

    roka

    Joined:
    Sep 12, 2010
    Posts:
    598
    The thing is that for my case, moving the big part of my game to the asset bundle use 50 MB more in memory.
    Without the asset bundle (for the big part of my game ),i use around 190 MB and by using the asset bundle i'm around 240 MB. Like i want to stay below the 256MB, it's not really an option.

    I have also see with the version 5.6 that when we enable GZ on the server, the onProgress return only 0,5,7.5 ( as result 0%,50%,75%) but if we disable the GZ, we can see the complet progress transition 0 ==> 1 (0% , 100 %).

    So why you have moved to the unityweb file without having the IndexedDB ready first? We don't had get the info before moving to the 5.6, so for a lot of us we have to wait again and again for something that could be avoided.
     
  27. Marco-Trivellato

    Marco-Trivellato

    Unity Technologies

    Joined:
    Jul 9, 2013
    Posts:
    1,654
    Have you tried to gz your asset bundle?

    Have you submitted a bug report?

    5.6 includes some major changes to Unity WebGL (hopefully for the better!) and this is one of those things that slipped through the cracks. Sorry for the inconvenience.
     
  28. ciorbyn

    ciorbyn

    Joined:
    Oct 17, 2013
    Posts:
    138
    Among other things, it seems that the maximum size of each single file is around 30Mb, beyond this value is not saved. So you have to distribute the weight on many assets.

    Also in my case is a problem. In addition to the fact that it is also a lot of extra work to overcome a problem that previously did not exist.

    Unfortunately, if I want to do the downgrade to the previous versions of Unity I have to modify a lot of items (shaders etc.) because despite the bakup when i went to the U5.6 I continued to develop the games on it without knowing that once compiled it would have presented this problem.

    I can only hope it will be restored in the upcoming updates.
     
  29. XSUnity

    XSUnity

    Joined:
    Nov 18, 2012
    Posts:
    18
    Marco, do you have any idea, when can we expect the good old IndexedDB caching to join the 5.6.x versions ?
     
  30. Marco-Trivellato

    Marco-Trivellato

    Unity Technologies

    Joined:
    Jul 9, 2013
    Posts:
    1,654
    We don't have an exact date yet. We will update you on this as soon as possible.
     
  31. ciorbyn

    ciorbyn

    Joined:
    Oct 17, 2013
    Posts:
    138
    I hope soon, I'm losing a lot of players (Not everyone has a fast connection) and if the loading time is high they abandon the game.
     
  32. Avol

    Avol

    Joined:
    May 27, 2016
    Posts:
    95
    I had the same problems, still have it. I believe the reason for that is the scale of final build. if it's over 50 smth mbytes it stops caching
     
  33. roka

    roka

    Joined:
    Sep 12, 2010
    Posts:
    598
    We have to wait after the unityweb file to be ready for the IndexDB......
    We can still use the asset bundle but like the asset bundle use more memory, it's not an option for most of us to merge the big part of the game into asset bundle.
     
  34. ciorbyn

    ciorbyn

    Joined:
    Oct 17, 2013
    Posts:
    138
    For the mement i have solved by making a backup of the projects and compiling them with the new beta 2017. This unfortunately can not be done if you have a multiplayer project with photon, because there are several conflicts. I tried to fix some but there are so many that it is not worth it.

    Hopefully in a next official update.
     
    mentolatux likes this.
  35. bebo77

    bebo77

    Joined:
    Aug 3, 2012
    Posts:
    84
    Not even beta for me! I have several games from 50mb to 70mb and the cache is stored up to a maximum of 30mb. I'm really annoyed, the problem is pretty serious and has not been solved for several months now. It seems that Unity and Chrome teams are trying to make crazy those who develop online games. Unfortunately not aware of the change of IndexedDB I have see this problem to finished work, which I can not publish for obvious reasons! Between a while I leave everything and go to grow tomatoes!:mad:
     
    mentolatux likes this.
  36. XSUnity

    XSUnity

    Joined:
    Nov 18, 2012
    Posts:
    18
    Hey Marco, it's been almost a month since your last post. Do you have any news for us ?
     
  37. Marco-Trivellato

    Marco-Trivellato

    Unity Technologies

    Joined:
    Jul 9, 2013
    Posts:
    1,654
    It looks like there is a regression in regards to IndexedDB caching, which we are still investigating. We will update you, hopefully soon.
     
  38. ciorbyn

    ciorbyn

    Joined:
    Oct 17, 2013
    Posts:
    138
  39. roka

    roka

    Joined:
    Sep 12, 2010
    Posts:
    598
    The Unity staff should fix the IndexedDB problem .... they have started with a new file format without been ready for the caching system ..... Reported a month ago and it's still the same ....
     
  40. ciorbyn

    ciorbyn

    Joined:
    Oct 17, 2013
    Posts:
    138
    I think the same, but with this step if we do not explore some alternatives we are left to ourselves. It's been too many months now.
     
  41. bebo77

    bebo77

    Joined:
    Aug 3, 2012
    Posts:
    84
    I not can wait and I want to go back to 5.5 ... Does anyone know how to downgrade to U5.5 without manually recompile all the materials?
     
  42. mentolatux

    mentolatux

    Joined:
    Nov 2, 2014
    Posts:
    240
    I ADDED manually , sorry bro is not other method
     
  43. bebo77

    bebo77

    Joined:
    Aug 3, 2012
    Posts:
    84
    Thank you bro!

    What a mess! I have to rework 198 materials.
    it's a nightmare!
     
  44. ciorbyn

    ciorbyn

    Joined:
    Oct 17, 2013
    Posts:
    138
    Unfortunately in 5.6 they have added new fields to the materials instructions. So 5.5 can not read them.

    First to modify the materials, I suggest you try to compile the game and make sure everything is ok. I have often heard that everything works on the editor, but once you've compiled some parts do not work properly.

    I currently have more than one game to go back, and each has over 200 materials.

    A madness!

    If you need workers I come also!
     
  45. bebo77

    bebo77

    Joined:
    Aug 3, 2012
    Posts:
    84
    Yes, iis true, I have the camera orbit that works correctly when I start on the editor, but when I compile does not move at all. I would not know how to fix it since the editor works properly.
    :(
    Some idea?
     
  46. Marco-Trivellato

    Marco-Trivellato

    Unity Technologies

    Joined:
    Jul 9, 2013
    Posts:
    1,654
    We are looking at how to fix the <buildname>.data.unityweb caching problem. For the time being, the best workaround is to minimize the data file size (by using asset bundles) so that it's small enough to be automatically cached by the browser.
     
  47. bebo77

    bebo77

    Joined:
    Aug 3, 2012
    Posts:
    84
    Unfortunately my level is basic. I'm trying to study how asset boundle process works, but I can not get anything good! There are many tutorials, but examples of very simple projects. On a complex project is not so intuitive.
     
  48. ciorbyn

    ciorbyn

    Joined:
    Oct 17, 2013
    Posts:
    138
    It seems that in the new release 2017.1 they have added a new tool for asset boundle. I do not know if it can be of help.

    Personally, i do not update Unity until they fix it with cache, do not want any more surprises for now, and asset bundle adds more weight to projects with which I'm already struggling to hold slight..
     
    Last edited: Jul 12, 2017
  49. bebo77

    bebo77

    Joined:
    Aug 3, 2012
    Posts:
    84
    I still have many difficulties with asset boundle. I use Unity because it's a intuitive tool and with a great community of developers that offer projects and tutorials, but if to publish a game I have to have all of these difficulties, the practicality that a less experienced developer like me found in unity no longer exists.
    Among other things, since webgl is still in development, you can not even get stuck at Unity 5.5!
    And no one assures us that the cache problem will be solved, because if I'm not mistaken we have this problem many months now, and is not even listed on the list of known issues.
     
  50. mehul-24

    mehul-24

    Joined:
    Jul 9, 2015
    Posts:
    2