Search Unity

[UnityCache] UnknownError: The serialized value is too large

Discussion in 'Web' started by Deleted User, Oct 1, 2019.

  1. Deleted User

    Deleted User

    Guest

    I've deployed a game I'm developing to WebGL. Unfortunately, whenever I open the play page, the main data file, "projectname.data.unityweb", is not being cached, but the others are.

    The error in the developer console (Firefox) states:
    [UnityCache] ....../Build/projectname.data.unityweb successfully downloaded but not stored in the indexedDB cache due to the error: UnknownError: The serialized value is too large (size=384093388 bytes, max=267386880 bytes)
    I know that from the error I'm encountering a definite cache limit, but I still want users who visit the game to have it saved in some way on their computer, so that obviously the file isn't redownloaded every time the page is opened.

    Does anyone have suggestions on what I can do?
     
  2. jukka_j

    jukka_j

    Unity Technologies

    Joined:
    May 4, 2018
    Posts:
    953
    The best option here is probably to migrate some of the date from the initial .data file over to asset bundles, and use a runtime download API (e.g. https://docs.unity3d.com/ScriptReference/Networking.UnityWebRequestAssetBundle.GetAssetBundle.html) to download the data. That way the initial data file can stay smaller, and time from first download to getting something rendering on the screen is faster too.

    I think the IndexedDB limit of 255MB is Firefox specific - other browsers may have other (even lower(!)) limits, e.g. Chrome in incognito mode seems to have a 100MB limit (https://stackoverflow.com/questions/10988569/storage-limits-on-chrome-browser)