Closed Bug 1478639 Opened 7 years ago Closed 7 years ago

Jump to definition sometimes lands in the wrong place because of long-lived cached 301 redirects

Categories

(Webtools :: Searchfox, defect)

defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: kats, Assigned: asuth)

Details

It is working for me. Does it work if you reload (the first page I guess)? I've had what feel like issues where caching results in stale values.
Huh, weird. Even after shift-reloading in Firefox Beta it gives me the same behaviour. But if I load it in Safari it works. I guess it must be caching something else.
Ah, it's caching the 301 response to https://searchfox.org/mozilla-central/define?q=_ZN7mozilla6layers21WebRenderBridgeParent14ClearResourcesEv&redirect=false If I disable the cache using the devtools networking panel it works correctly.
Status: NEW → RESOLVED
Closed: 7 years ago
Resolution: --- → INVALID
Should we maybe put an explicit, shorter 'expires' directive on the 301's given that they're harder to refresh around? It looks like we could convert the "expires 1d" nginx config[1] to something like: ``` # prolog up above map $status $expires { default 1d; 301 10m; } # replace "expires 1d" with: expires $expires; ``` It also turns out that we can specify absolute times of day for expires using "@", but I think that would only work if we were sticking with once-a-day indexing and we reliably knew when the next index would be available and go live. 1: both: https://github.com/mozsearch/mozsearch/blob/master/scripts/nginx-setup.py#L80 https://github.com/mozsearch/mozsearch/blob/master/scripts/nginx-setup.py#L59
That sounds reasonable to me. Want to make a PR for that?
Sure.
Assignee: nobody → bugmail
Status: RESOLVED → REOPENED
Resolution: INVALID → ---
Summary: Jump to definition sometimes lands in the wrong place → Jump to definition sometimes lands in the wrong place because of long-lived cached 301 redirects
Pull request at https://github.com/mozsearch/mozsearch/pull/124 after getting vagrant working on my new beefy build box. Tested locally. Note that I misunderstood what was going on in my initial descriptions. The 301 was not affected by any "expires" directive. The change I make causes the same expiration map rule to be applied to _everything_ served by nginx, which is actually altering the status quo for everything we proxy pass. This could mean that the default of 1 day is actually an increase in some cases.
Status: REOPENED → ASSIGNED
PR merged, marking fixed.
Status: ASSIGNED → RESOLVED
Closed: 7 years ago7 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.