# Redirects performance: permalinks vs nginx

**URL:** <https://meta.discourse.org/t/redirects-performance-permalinks-vs-nginx/65482>\
**Category:** Development\
**Created:** [2. Juli 2017 um 17:56 UTC](https://meta.discourse.org/t/redirects-performance-permalinks-vs-nginx/65482 "2017-07-02T17:56:35Z")\
**Posts on this page:** 1\
**Showing post:** 1

<div class="post-metadata">

**Author:** ![pfaffman](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pfaffman/32/120154_2.png) [@pfaffman](https://meta.discourse.org/u/pfaffman)\
**Post date:** [2. Juli 2017 um 17:56 UTC](https://meta.discourse.org/t/redirects-performance-permalinks-vs-nginx/65482/1 "2017-07-02T17:56:35Z")

</div>

I’ve just submitted a PR for the mybb importer that includes permalinks for users, categories, and topics (in Discourse terminology. The person I did it for is concerned that having Discourse handle these will be less efficient than having NGINX do it.

My naive understanding is that until rails goes looking for permalinks there’s no performance hit (other than a bit of database overhead) and when it does go looking, it does a single indexed database search. I’d think that if an external NGINX were doing it, it would be looking at all of those redirects on every query, but that can’t be right (can it?).

I’ve seen some discussions, though, about having an external nginx handle these redirects, and at least one importer generates a CSV file to use to do external redirects. What are the tradeoffs?

There are about 25K users, 150 categories, and 12K topics plus one `permalink normalization` to remove cruft after the `.html` in the URL.

---

_[View the full topic](https://meta.discourse.org/t/redirects-performance-permalinks-vs-nginx/65482)._
