Project Dependencies Fetched Every Time

Are the project dependecies supposed to be fetched every time the project is open? It’s what’s happening to me and as my internet connection is not so great, it takes forever :frowning:

I’m using Defold-x86_64-win32 1.2.144 on windows 10, but the same thing is happening with my friend using Ubuntu.

Thank you very much.

Download all dependency zips and then serve them by a local http server (like HFS). You’ll then need to manually update them.

2 Likes

That’s exactly what I’m doing, but it’s just a workaround, right?

1 Like

Yes, it is a workaround for those who have bad connections. I guess there are things we could do on our end to speed things up. Maybe we shouldn’t fetch libraries every time the editor is started. @mats.gisselson do you recall why we do it on startup? Couldn’t we use the ones in .internal/?

2 Likes

Looking at the code, it seems we do use the ones from .internal. Might be something that is causing us to think they’re in need of an update though. Sounds like a bug to me.

5 Likes

@shinnildev Would you please create a bug report via Help->Report Issue?

Sure, it’s done.

Thank you very much.

1 Like

I think we have this issue: https://github.com/defold/editor2-issues/issues/1695

Oh, wow. I thought this was intentional, since the dependencies could have been updated at any point.

1 Like

Isn’t it like this:

  • If you start the editor without an internet connection (not a slow one but no connection at all) then we use the libraries we have cached without in any way delaying startup of the editor
  • If you start the editor with an internet connection (no matter if it is a slow or a fast one) then we check for changes. And by “check for changes” I mean that we use ETags right? Or do we actually download the dependency every time without checking if the resource has changed?

Yes, we check for changes using the ETags. We’re only supposed to download the updated zip files if the ETags differ for a dependency.

We’ll need to investigate if it works as intended, but presumably just checking the ETags should be quick even on a slow connection?

@shinnildev How slow is forever? Can you confirm that it really does download the dependencies every time (check timestamp on files in .internal folder)? Are the dependencies hosted on GitHub?

IIRC we’ve had problems with dependencies hosted on github. The .zip ends up on some cloud service that apparently does not respect our If-None-Match header :frowning:

2 Likes

@britzl it takes from 3 to 7 minutes to fetch de dependency. Yes, it’s hosted on github. I’ll check the timestamp as soon as I touch my computer.

1 Like

@britzl Well, the .internal timestamp doesn’t change.

And that goes for the files inside the folder as well?

If that is the case then your problem is that checking if any of the dependencies need an update is slow.

What kind of internet connection do you have and where are you located?

A workaround is to start the editor with wifi turned off and ethernet unplugged.

@britzl the directory ./internal/cache timestamp still unchanged, but ./internal/lib updates every time. My internet speed is 2 Mbps ADSL from Brazil, very slow, I know :cry:

Thanks, I’ll try do this.

2 Likes