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

Expand shortened URLs? #1082

Open
charmander opened this issue Jul 14, 2021 · 0 comments
Open

Expand shortened URLs? #1082

charmander opened this issue Jul 14, 2021 · 0 comments

Comments

@charmander
Copy link
Contributor

Sometimes people end up putting shortened URLs places; sometimes it’s by accident. We should consider undoing this, since it’s unnecessary tracking, latency, phishing risk, unsearchability, and plenty more bad stuff.

  • t.co
  • bit.ly

I think fully expanding user links, but preserving the shortened link text while rewriting the link target for Markdown, makes sense.

Proposed implementation:

  • new table link_expansions (shortened text PRIMARY KEY, destination text, created timestamptz NOT NULL DEFAULT now(), fetched timestamptz) where shortened is normalized (no protocol or irrelevant querystring)
  • insert when editing user links or Markdown
  • background process to fill destination IS NULL rows by least recently fetched (nulls first) and least recently created
  • query (cache_multi_on_arguments with should_cache non-null and non-shortened; recursive) when rendering user links or Markdown, falling back to original link when not successfully fetched yet
  • rendering can also remove redirects like google.com/url
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant