Closed Bug 730715 Opened 12 years ago Closed 12 years ago

kumascript: Minimize template loading and execution

Categories

(developer.mozilla.org Graveyard :: Editing, defect)

x86
macOS
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: lorchard, Assigned: lorchard)

References

Details

(Whiteboard: u=user c=wiki p=2)

This probably deserves its own bug. To get and compile templates used by macros, kumascript needs to make HTTP requests to Kuma for wiki doc source. The response from this request can be cached, but we need to be smart about it.

* Templates need to be reloaded and recompiled whenever the source is edited
* How long can cache entries live, assuming none of the above changes? (ie. 5 min? 60 min?)
Blocks: 659364
Target Milestone: --- → 2.5
Whiteboard: u=user c=wiki p=
Assignee: nobody → lorchard
Whiteboard: u=user c=wiki p= → u=user c=wiki p=2
Target Milestone: 2.5 → 2.6
Progress: https://github.com/mozilla/kumascript/pull/3

I've kind of rethought this bug a bit. It doesn't seem like using HTTP caching for templates from Kuma ends up being a very big win. I'm having a hard time thinking of a useful scenario where a fresh response from kumascript shouldn't also fetch a fresh document and fresh copies of all the templates needed.

So, instead, I spent some time reworking things so that:

* Templates only get loaded once for each uniquely named macro (ie. HTMLElement vs CSSXref)

* Templates only get executed once for each unique combination of macro name and arguments (ie. HTMLElement('li') vs HTMLElement('div'))

That should minimize both HTTP traffic and CPU time even when generating a fresh evaluation of a wiki document.
Summary: kumascript: Use caching in kumascript for requests to Kuma for template source → kumascript: Minimize template loading and execution
I think this has been merged
Status: NEW → RESOLVED
Closed: 12 years ago
Resolution: --- → FIXED
Version: MDN → unspecified
Component: Docs Platform → Editing
Product: developer.mozilla.org → developer.mozilla.org Graveyard
You need to log in before you can comment on or make changes to this bug.