Closed
Bug 582042
Opened 15 years ago
Closed 14 years ago
Platform detection in Zeus
Categories
(mozilla.org Graveyard :: Server Operations, task)
mozilla.org Graveyard
Server Operations
Tracking
(Not tracked)
RESOLVED
FIXED
People
(Reporter: abuchanan, Assigned: oremj)
Details
Implementing simple platform detection in Zeus and setting a custom header with the result, e.g. Moz-Platform: MacOSX, would allow us to Vary: Moz-Platform, which would simplify our download button code on mozilla.com (and make our pages faster too).
The TrafficScript would look something like,
$ua = http.getHeader("User-Agent");
$os_windows = 'windows';
$os_mac = 'mac';
$os_mac_osx = 'macosx';
$os_linus = 'linux';
$os_solaris = 'solaris';
$os_other = 'other';
$os = $os_other;
if (string.find("Win32", $ua) != -1 || string.find("Win64", $ua) != -1)
$os = $os_windows;
else if (string.find("Linux", $ua) != -1)
$os = $os_linux;
else if (string.find("Mac OS X", $ua) != -1)
$os = $os_macosx;
else if (string.find("MSIE 5.2"", $ua) != -1)
$os = $os_macosx;
else if (string.find("Mac"", $ua) != -1) {
$os = $os_mac;
# Special case for Opera on OS X emulating IE (bug 402113)
if ((string.find("Opera"", $ua) != -1) && (string.find("Opera 6"", $ua) == -1))
$os = $os_macosx;
} else if (string.find("SunOS", $ua) != -1)
$os = $os_solaris;
else
$os = $os_other;
http.addHeader('Moz-Platform', $os);
What do you think? Good idea? Terrible idea?
Reporter | ||
Comment 2•15 years ago
|
||
Will you have a chance to look at this soon?
Comment 3•15 years ago
|
||
alex, he's out until Thursday - do you need this sooner?
Reporter | ||
Comment 4•15 years ago
|
||
(In reply to comment #3)
> alex, he's out until Thursday - do you need this sooner?
ah, ok thanks. no, it can wait.
Assignee | ||
Comment 5•14 years ago
|
||
I have this traffic script in Zeus, and the header will be "X-Moz-Platform" where should I enable to test it out?
Reporter | ||
Comment 6•14 years ago
|
||
How about www-trunk.stage? Or, even mozilla.com production, since it's an extra header, it shouldn't disrupt anything.
Assignee | ||
Comment 7•14 years ago
|
||
I've added this to production. www-trunk.stage is still behind the netscaler.
Assignee | ||
Updated•14 years ago
|
Status: NEW → RESOLVED
Closed: 14 years ago
Resolution: --- → FIXED
Updated•10 years ago
|
Product: mozilla.org → mozilla.org Graveyard
You need to log in
before you can comment on or make changes to this bug.
Description
•