Search Unity

GetAssetBundle cache issue

Discussion in 'Asset Bundles' started by ksrf, Apr 29, 2019.

  1. ksrf

    ksrf

    Joined:
    Apr 9, 2016
    Posts:
    3
    Hi,
    I am using GetAssetBundle and I want to cache the bundles.

    string bundleURL;

    //bundleURL is : *******

    UnityWebRequest webReq = UnityWebRequestAssetBundle.GetAssetBundle(bundleURL,1,0);

    This works fine at first time. It downloads the bundle and I can get the prefab in it. Everything is fine.

    But when I change the bundleURL to this : ********

    It does not download the bundle. I try to get the prefab and it gets the downloaded bundle at the cache and brings the prefab from old bundle.

    URL's are too long so I shorten them to write here.No problem with its usabilities

    When I try to different urls like github links, it works.

    Is there a problem with URLs. They have '?' (query string). Is this a problem? Why is it doing like it downloaded the bundle?
    Of course I clear the cache at the beginning

    (SOLVED: Unity ignore the querry strimg so my my urls will same)
     
    Last edited: May 2, 2019
  2. MrG

    MrG

    Joined:
    Oct 6, 2012
    Posts:
    368
    ksrf likes this.
  3. ksrf

    ksrf

    Joined:
    Apr 9, 2016
    Posts:
    3
    Using this link, I can download the file.
    https://beta-uygulama****

    and using this link I can download the other file
    https://beta-uygulama-****

    They are different files but unity doesnt download the second file. It takes the first downloaded file. Why?
    There is no problem with downloading files.(also no downoading error) When I try to download the second file first, it can download.
     
    Last edited: May 2, 2019
  4. MrG

    MrG

    Joined:
    Oct 6, 2012
    Posts:
    368
    Because AssetBundle caching sees only downloadvitDocument.json and ignores all the rest.
     
    ksrf likes this.
  5. ksrf

    ksrf

    Joined:
    Apr 9, 2016
    Posts:
    3
    Ohh, really. OK I get it. Thank you so much