× Here you can get community support related to ReDJ.

Do many redirects slow my site

  • bonaventure
  • Topic Author
  • Offline
  • Junior Member
  • Junior Member
More
10 years 3 months ago #2020 by bonaventure
Do many redirects slow my site was created by bonaventure
I'm considering using this redirect to create internal redirects for 50,000 users or more. Will this slow my site down?

Please Log in or Create an account to join the conversation.

More
10 years 3 months ago #2021 by admin
Replied by admin on topic Do many redirects slow my site
It depends...
ReDJ and Tag Meta are very optimized for performance. The rule check is just a single query for each call. If you think to insert 50,000 rules maybe the query could be a little "heavy", but this is NOT the way they should work.

Each rule can represent many URLs through regular expressions, and using macros the destination is dynamic and different for each source URL. So, usually with a few rules you can manage a lot of redirects.

If you need more help about this, please, provide more information about what you need to accomplish.

Kind regards,
Luigi

Please Log in or Create an account to join the conversation.

  • bonaventure
  • Topic Author
  • Offline
  • Junior Member
  • Junior Member
More
10 years 3 months ago #2022 by bonaventure
Replied by bonaventure on topic Do many redirects slow my site
Unfortunately, I'm not sure that will apply in my case as each url must point to a specific users page (sort of like a Community Builder Profile, except I'm using a custom CCK). With this many users, I may need to use a url shortening service like Google or bitly, but I was hoping that I could create aliases on my own domain (much better for branding our products).
Please let me know if you think I'm missing something. Thanks for your quick reply.

Please Log in or Create an account to join the conversation.

More
10 years 3 months ago #2023 by admin
Replied by admin on topic Do many redirects slow my site
The only case you are right is if any URL is completely random and not related to users in any way. As I told you you can use macros to build the destination, and there are a lot of macros available. As example, if the URL contains the username, let me say /community/selfget (where selfget is my username, this is just an example) then you can match any URL with "/community" and extract the "selfget" part. Then you can lookup a table to search for a "selfget" and get the information to build the destination (e.g. the user id).

Please Log in or Create an account to join the conversation.

  • bonaventure
  • Topic Author
  • Offline
  • Junior Member
  • Junior Member
More
10 years 3 months ago #2024 by bonaventure
Replied by bonaventure on topic Do many redirects slow my site
Forgive my ignorance. I think I'm understanding you, but I'd like to be sure.
This is my scenario:

Let's assume that selfget has purchased 4 animal ID tags for each of his pets, and each one has a QR-Code url that leads to the online profile for that particular animal. An actual profile for one of selfget's pets may reside at /horses/5/ABCD, where "horses" is the animal category, "5" is the article id, and "ABCD" is the ID for the tag itself. The shortened url should be /ABCD, and this is the url that will be printed on the tag that gets issued for that animal. Thus /ABCD should be directed to /horses/5/ABCD.
Similarly, animal two might be /horses/6/ABCA and the shortened url would be "/ABCA". Every tag is unique. I think you're saying that I could lookup the article id and tag id using macros and use the same rule for every animal. If true, I assume that it wouldn't matter how many animals I added to the database. Am I getting this correct?

Please Log in or Create an account to join the conversation.

More
10 years 3 months ago #2025 by admin
Replied by admin on topic Do many redirects slow my site
Ok,
the only constraint is that ABCD is unique, and I mean NO another ABCD (no matter if they are horses or dogs or whatever...). If this is true, you could build a single rule to redirect (even internally) all your URLs.

First problem to solve:
The From URL should match only

/ABCD
...
/ABCA

But not URLs like:

/download
/news
...

This could be done using a subdir for tags like:

/tag/ABCD
/tag/ABCA

The rule could be:

^/tag/

THe destination could be build searching ABCD in the database. This should return 5, and a second lookup should return horses (you can do as many lookup as you need using placeholders). After this you will be able to build the destination.

Anyway, if you want to try, just download and install the Community version... is free. :)

Kind regards,
Luigi

Please Log in or Create an account to join the conversation.

Time to create page: 0.126 seconds