Skip to content

Support URLs up to 2048 characters#207

Merged
riasvdv merged 8 commits intoriasvdv:mainfrom
Boefjim:feature/longer-urls
Feb 11, 2025
Merged

Support URLs up to 2048 characters#207
riasvdv merged 8 commits intoriasvdv:mainfrom
Boefjim:feature/longer-urls

Conversation

@Boefjim
Copy link
Copy Markdown
Contributor

@Boefjim Boefjim commented Feb 11, 2025

Description

Since some of our redirects contain some large query parameters, we would like the URL field limit to be increased to 2048 characters (this is a generally agreed upon limit, although no exact limit has been defined nor enforced).

Since column indexes only work for columns up to 255 characters, I have added an additional MD5 hashed column.
Since a MD5 hash is always 32 characters long, this can be indexed and should be decently unique.
I have adjusted the queries to use this new indexed column, so the speed of these queries should be similar to how they were.
The queries will still ensure the actual URL matches, since there is still a chance for different URLs to have the same MD5 hash.

I also noticed that when publishing the migrations of the plugin, they are ordered alphabetically, which does not run properly (since adding a description column to the redirects table happens before the redirects table even exists).
So I have also adjusted this so that it adds a single second to the timestamp of the migrations that should be run after the original tables are created (including these new migrations), making it easier to use the plugin.

@Boefjim Boefjim force-pushed the feature/longer-urls branch from 32ff3bd to 8a385b5 Compare February 11, 2025 12:27
@riasvdv riasvdv merged commit 2e9d342 into riasvdv:main Feb 11, 2025
3 checks passed
@riasvdv
Copy link
Copy Markdown
Owner

riasvdv commented Feb 11, 2025

Thank you for this!

@Boefjim Boefjim deleted the feature/longer-urls branch February 12, 2025 12:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants