Closed
Bug 616702
Opened 15 years ago
Closed 15 years ago
[tracker] Move in-product redirects into Kitsune
Categories
(support.mozilla.org :: Code Quality, task)
support.mozilla.org
Code Quality
Tracking
(Not tracked)
VERIFIED
FIXED
2.5
People
(Reporter: jsocol, Unassigned)
References
Details
In-product redirects are handled through .htaccess now, which is a pain for two reasons:
1) They required code pushes to change.
2) They require us to _have_ an .htaccess file.
As of 2.4, all pages are being served through Kitsune, so we could simplify pushes and the hosting infrastructure if we stopped using .htaccess.
I imagine something similar to django-redirect, but more specific for this purpose (actually we might need two things, one for this and one for generic things like /twitter => /army-of-awesome, but the latter is a separate bug).
We map ^1/ to an "inproduct" app with a single view that takes several arguments:
def redirect(request, product, version, platform, locale, page):
This also reduces the number of lines of regex we need from dozens to one/two.
Then we can have a redirect model that looks something like
class Redirect(Model):
product
version
platform
locale
page
where all the fields are nullable. I'm not entirely sure how to do this yet, but I think we need to cascade down the chain, but we can do something like:
objs = Redirect.objects.all()
if objs.filter(product=product).exists():
objs = objs.filter(product=product)
if objs.filter(version=version).exists():
# etc...
That should cover any cases we have in the redirects right now. (Normally all of these will be NULL except page.)
We can cache these redirects for a long time so Zeus serves them, and use Hera to flush them when they change (bug 616701).
| Reporter | ||
Comment 1•15 years ago
|
||
The use case that the algorithm in comment 0 covers is basically what we have now:
/any/any/any/any/some-page is the most common, but a few take precedence:
/any/any/iPhone/any/ => article about Firefox Home.
/any/4.0b/any/any/ => article about Firefox 4.0 beta.
The queries in comment 0 should also live in memcache relatively quickly, and if we just do .exists() queries they shouldn't take up much room.
| Reporter | ||
Updated•15 years ago
|
Summary: [tracer] Move in-product redirects into Kitsune → [tracker] Move in-product redirects into Kitsune
| Reporter | ||
Comment 2•15 years ago
|
||
2.5 may be overly ambitious, but I wanted to get this out of "Future." Also, if we move the .htaccess file (bug 622689) then this doesn't block bug 616703.
No longer blocks: 616703
Target Milestone: Future → 2.5
| Reporter | ||
Comment 3•15 years ago
|
||
Calling this done. We send cache headers for 24-hours to Zeus right now. Hera is nice to add but not crucial.
You need to log in
before you can comment on or make changes to this bug.
Description
•