Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice

WebGL Data Cache (IndexDB key issue)

Discussion in 'WebGL' started by CurtisLinden, Dec 11, 2015.

  1. CurtisLinden

    CurtisLinden

    Joined:
    Oct 26, 2015
    Posts:
    10
    Hi.

    I turned on the data cache to see how well it works and it does work.

    Unfortunately for me (and maybe others) It is caching by the URL path fragment.

    I need a way to configure the key.

    Since my builds are versioned - If I could get a callback for generating the key.. I could inject
    the version of the WebGL.data file and the filename as a key and be able to use the file across paths.

    Is there any way that I can generate this key instead?

    Thank you.
     
    Last edited: Jan 11, 2016
  2. jonas-echterhoff

    jonas-echterhoff

    Unity Technologies

    Joined:
    Aug 18, 2005
    Posts:
    1,666
    IndexedDB is not shared across domains (for obvious security reasons - you don't want any web site to access any private information another web site stores), so what you are asking for is not possible.
     
  3. CurtisLinden

    CurtisLinden

    Joined:
    Oct 26, 2015
    Posts:
    10
    Hi Jonas.
    Sorry - across domains was a typo.

    I meant to say "I could inject the version of the WebGL.data file and the filename as a key and be able to use the file across URL path fragments".

    The key is the URL path fragment and we use the same file for many url path fragments.

    ie
    /play/123
    /play/232
    /play/33243

    all the same WebGL.data


    I would like to be able to configure the key so that i can use the caching.
    ie:
    'my_key_name-1.23.1-1-webdata'
     
  4. CurtisLinden

    CurtisLinden

    Joined:
    Oct 26, 2015
    Posts:
    10