Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cache remote configs #5176

Closed
1 task done
Chinoman10 opened this issue Jun 27, 2024 · 1 comment
Closed
1 task done

Cache remote configs #5176

Chinoman10 opened this issue Jun 27, 2024 · 1 comment
Assignees
Labels
🚀 feat New feature

Comments

@Chinoman10
Copy link

Code of Conduct

  • I agree to follow this project's Code of Conduct

What would you like to see added?

Some background

Over the years I've developed a .bash_aliases with a couple thousand lines, filled with not only aliases but also a bunch of functions I use frequently. Because I change it somewhat frequently and I manage a bunch of machines, it sucks to keep them up-to-date.

What I've done to improve this experience, is that at the end of the file, it checks if there's an update, and if so, it displays a message above the prompt (similar to how Ubuntu does it), including the alias to download & apply the last version.
One other option I've added is doing it automatically (effectively checking for a newer version every time a shell is created), but I've grown not a fan of this because it takes a few hundred MS (sometimes over 1s) to check, download and apply before the prompt is ready to use.

Concern

I'm afraid this'll happen to my OMP config if I start using a remote config file as well.

Request

So I'd like to be able to --config '<remote-url> -m (-m (manual) or -c (check), for example), so that it checks for an update, and if there is one, it prompts me to update it, or perhaps it changes the prompt's color or something as a means of alerting me.
This would mean that the config would have to be cached (stored locally) for performance, and checked for updates in the background.

Notes

I'd be happy to add additional notes or answer any questions to iterate on this feature request.

@JanDeDobbeleer
Copy link
Owner

@Chinoman10 the remote config is cached for the current shell session. Every time you start your shell, it will "refresh". Every subsequent prompt, it will use the local cache. Is that what you mean or do you also want to check if it needs to download the file and replace based on a HEAD request and check the Last-Modfied header?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🚀 feat New feature
Projects
None yet
Development

No branches or pull requests

2 participants