Easy way to set up a caching proxy for github to make elm-install run faster?

157 views
Skip to first unread message

Rupert Smith

unread,
Oct 3, 2017, 11:32:09 AM10/3/17
to Elm Discuss
I tend to use elm-install to manage my package dependencies, as it also caches them locally. However, it needs to reach out to github to check for any updates, each time it is run. I am working on a slow internet connection some of the time.

Does anyone know of an easy way to set up a caching proxy for github? The first time a repository is cloned from github, the cache should make a copy of the clone. Maybe a config option to tell it how often to update any clones it holds, once a day will be enough for me.

Rupert Smith

unread,
Oct 3, 2017, 11:54:39 AM10/3/17
to Elm Discuss
On Tuesday, October 3, 2017 at 4:32:09 PM UTC+1, Rupert Smith wrote:
I tend to use elm-install to manage my package dependencies, as it also caches them locally. However, it needs to reach out to github to check for any updates, each time it is run. I am working on a slow internet connection some of the time.

Does anyone know of an easy way to set up a caching proxy for github? The first time a repository is cloned from github, the cache should make a copy of the clone. Maybe a config option to tell it how often to update any clones it holds, once a day will be enough for me.

I suppose another way would be to modify elm-install such that it take a command line argument that tells it to skip checking for updates. Maybe -o for offline mode. 

Gusztáv Szikszai

unread,
Oct 4, 2017, 12:02:30 AM10/4/17
to Elm Discuss
I suppose another way would be to modify elm-install such that it take a command line argument that tells it to skip checking for updates. Maybe -o for offline mode.
There is one it's the --skip-update I've added it in the v1.6.0 release

Rupert Smith

unread,
Oct 6, 2017, 5:31:34 AM10/6/17
to Elm Discuss
On Wednesday, October 4, 2017 at 5:02:30 AM UTC+1, Gusztáv Szikszai wrote:
I suppose another way would be to modify elm-install such that it take a command line argument that tells it to skip checking for updates. Maybe -o for offline mode.
There is one it's the --skip-update I've added it in the v1.6.0 release

Excellent, that is very helpful, thanks. 

Chad Woolley

unread,
Oct 6, 2017, 10:42:20 AM10/6/17
to elm-d...@googlegroups.com
I asked Evan about this at last week's ElmConf, and he said in the next release of Elm, there will be changes that make it easier to cache dependencies which have previously been downloaded.

-- Chad

--
You received this message because you are subscribed to the Google Groups "Elm Discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elm-discuss+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Rupert Smith

unread,
Oct 11, 2017, 5:31:05 PM10/11/17
to Elm Discuss
On Friday, October 6, 2017 at 3:42:20 PM UTC+1, Chad Woolley wrote:
I asked Evan about this at last week's ElmConf, and he said in the next release of Elm, there will be changes that make it easier to cache dependencies which have previously been downloaded.

Yes, elm-install already does this. Unfortunately, as it just clones a git repo, it ends up doing a significant amount of work just to decide if a new version has become available since the last cached one. I wonder though if it is doing this as efficiently as possible?

In Java land we have the Maven repositories, where artifacts are packages as binaries (.jar files), and the repo meta data is held separately in a small xml file. It means checks for updates only requires downloading that small xml file. You can also limit how frequently updates are checked for.

There are also package managers such as Nexus, that are easy to set up as proxies on the central repository. Once you have Nexus running on you local development network and configured nicely, it all goes much faster. In fact, I also have an apt-proxy running in my development network as I am frequently creating new Debian virtual machines.

It would likely be possible to write a plugin for Nexus that supports Elm - it started out as a Maven package manager but has now evolved to cover other packaging formats like npm.

Anyway, I'm sure Evan has will work things out nicely for Elm 0.19, and probably not much point in figuring out the direction of third party tooling to fill any gaps until that is out.
Reply all
Reply to author
Forward
0 new messages