Closed
Bug 747166
Opened 13 years ago
Closed 13 years ago
kumascript: Optimize wiki.page
Categories
(developer.mozilla.org Graveyard :: Wiki pages, defect, P2)
Tracking
(Not tracked)
RESOLVED
FIXED
People
(Reporter: lorchard, Assigned: lorchard)
References
Details
(Whiteboard: u=contributor c=wiki s=2012-05-22 p=)
In building DekiScript API shims, I found wiki.page. This allows one page to include the content of another page, with macros evaluated and class="noinclude" blocks omitted.
As it happens, some pages use this liberally and that generates a lot of HTTP requests. en/XUL/textbox, for one, generates a few hundred requests to build that page from dozens of others.
Part of this can be addressed with bug 747151, by minimizing how many requests kumascript needs to make to kuma for auto-required libs and other templates.
bug 747160 might help too, if wiki.page can use memcache to cache some of its own results.
Assignee | ||
Updated•13 years ago
|
Assignee | ||
Comment 1•13 years ago
|
||
And here's a peek at the code from http://mdn.lmorchard.com/en-US/docs/en-US/Template:DekiScript:Wiki
// Retrieve the content of a document for inclusion
// TODO: NEED CACHING HERE, BADLY!
page: function (path) {
var p = kuma.url.parse(env.url, true);
var base = p.protocol + '//' + p.host + '/en-US/docs/';
var doc_url = base + path + '?raw=1¯os=1&include=1';
var opts = { method: 'GET', url: doc_url };
var result = '';
var f = new Future();
request(opts, function (err, resp, body) {
if (resp && 200 == resp.statusCode) { result = body; }
f.return();
});
f.wait();
return result;
},
Assignee | ||
Comment 2•13 years ago
|
||
Maybe part of this optimization is to set really long expiration times on cached results on the KumaScript side. Then, invalidate cache entries from the Kuma script side when pages are saved. This would assume a shared naming convention in the cache on both sides.
Updated•13 years ago
|
Whiteboard: u=contributor c=wiki s=2012-05-22
Assignee | ||
Comment 3•13 years ago
|
||
Assignee | ||
Comment 4•13 years ago
|
||
Status: NEW → RESOLVED
Closed: 13 years ago
Resolution: --- → FIXED
Updated•13 years ago
|
Updated•13 years ago
|
Priority: -- → P2
Comment 5•13 years ago
|
||
Retroactively setting assignee to Les.
Assignee: nobody → lorchard
Whiteboard: u=contributor c=wiki s=2012-05-22 → u=contributor c=wiki s=2012-05-22 p=
Updated•12 years ago
|
Version: Kuma → unspecified
Updated•12 years ago
|
Component: Website → Landing pages
Updated•5 years ago
|
Product: developer.mozilla.org → developer.mozilla.org Graveyard
You need to log in
before you can comment on or make changes to this bug.
Description
•