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

Version 1.0: Move to file-based redirect storage #11

Closed
kristianfreeman opened this issue Dec 6, 2020 · 1 comment · Fixed by #12
Closed

Version 1.0: Move to file-based redirect storage #11

kristianfreeman opened this issue Dec 6, 2020 · 1 comment · Fixed by #12
Labels
enhancement New feature or request

Comments

@kristianfreeman
Copy link
Owner

kristianfreeman commented Dec 6, 2020

Currently lilredirector is based on Workers KV storage. This is an interesting and useful look at how quick it can be to spin something up with KV, but it leaves a lot to be desired in a number of ways when it comes to practically and efficiently using lilredirector at scale:

  1. Lots of manual configuration that requires intermediate+ understanding of Workers and Wrangler (setting up a KV namespace, adding it to wrangler.toml, etc)
  2. No tracking of when a redirect was added, or by whom
  3. View counts are useful but inaccurate with KV as it stands -- Durable Objects can fix this but isn't necessarily any better at issues 1 or 2

Moving to a file-based system, e.g. loading in JSON or something similar, will mitigate the above issues. A file can be tracked via Git, easily moved between environments (e.g. in development or production), and will have minimal impact on file size for most situations.

In version 1.0, lilredirector will load redirects from a file as the Worker boots up. This will likely make it easier to support more advanced configuration as well (e.g. regex support as requested in #10), and remove a ton of code for managing the UI and associated API routes for managing these redirects at the edge.

Note that this is like..... a really breaking change. In addition, I'll need to spend some time specifying what the file looks like -- for instance, is it JSON? TOML? YAML? There's a ton of things to figure out here, but in case anyone is interested in the long-term direction of this project, I wanted to document some of this stuff and make it available for discussion.

Side note: there's been some discussion in the Workers discord re: text bindings, which are used for the static asset manifest. Because they aren't supported by Wrangler, I don't think it's the right direction right now, though there's definitely an argument to be made that since we're using something very similar for Workers Sites (using text bindings to map paths to known filenames), it could probably be a good fit here as well. I'd revisit this as an option in the future if Wrangler supports easy management of those values.

@kristianfreeman kristianfreeman pinned this issue Dec 6, 2020
@kristianfreeman kristianfreeman added the enhancement New feature or request label Dec 6, 2020
@kristianfreeman kristianfreeman changed the title Move to file-based redirect storage Version 2.0: Move to file-based redirect storage Dec 6, 2020
This was referenced Dec 6, 2020
@kristianfreeman kristianfreeman changed the title Version 2.0: Move to file-based redirect storage Version 1.0: Move to file-based redirect storage Dec 6, 2020
@kristianfreeman
Copy link
Owner Author

lol, apparently we weren't on version 1.0 yet, so calling this version 2.0 doesn't make much sense. 1.0 it is!

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

Successfully merging a pull request may close this issue.

1 participant