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

Consider getting rid of catchall route #800

Open
zbycz opened this issue Nov 22, 2024 · 3 comments
Open

Consider getting rid of catchall route #800

zbycz opened this issue Nov 22, 2024 · 3 comments

Comments

@zbycz
Copy link
Owner

zbycz commented Nov 22, 2024

Otherwise all random stuff is routed to [...all] and full application is rendered, which takes a lot of execution time.

Eg.

  • Old stuff like /sw.js
  • old urls like /logo/osmapp.png
  • or random attacks like /wp-admin

TO CONSIDER (!)

We would need to move shortener from https://osmapp.org/xxxn to eg. https://osmapp.org/s/xxxn which would "change permalinks"

@Dlurak
Copy link
Collaborator

Dlurak commented Nov 26, 2024

If it is only about minimizing execution time it should also be enough to only block the relevant urls like /sw.js /logo/osmapp.png and /wp-admin...

You can export the vercel logs as json and then use the following command to get a list of all URIs:

jq ".[].requestPath" logs_result.json -r |  sed 's/^[^/]*//'

While Vercel offers to export up to 1.000.000 requests, you need to be on a paid plan to really get that many requests, else you only get the amount that you can see for free. Still running that script regulary might give you an overview over problematic urls

@zbycz
Copy link
Owner Author

zbycz commented Nov 29, 2024

THX! I didn't know I could export all of them.

Currently we are on Pro plan, because we reached the limit. But i plan to downgrade to Hobby next billing period.

I added the static files to limit some unneeded executions of catchall route (#801).

Other experiments: #777, #808

@zbycz
Copy link
Owner Author

zbycz commented Dec 19, 2024

Update: many failed requests are caused by a buggy asPath on vercel deployments - fixed in #800.

Fortunately Vercel added observability tab, which nicely sums our invocations in last 12 hours.
image

There is loads of bot attacs like /wp-admin etc.

Resolution: we will get rid of the catchall route, in case no route matches just a static 404 will be shown, which also has to include link to the main app + client script to redirect old shortener URLs to new version /s/xxxyn.

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

No branches or pull requests

2 participants