Closed Bug 1161505 Opened 10 years ago Closed 10 years ago

[toolkit] Provide an implementation of custom cache

Categories

(Firefox OS Graveyard :: Gaia, defect)

defect
Not set
normal

Tracking

(b2g-master fixed)

RESOLVED FIXED
Tracking Status
b2g-master --- fixed

People

(Reporter: salva, Assigned: salva)

References

Details

(Whiteboard: [s1])

V3 architecture includes the concep of custom cache [1]. Provide a running example of that for a use case still to be defined. [1] https://wiki.mozilla.org/Gaia/Architecture_Proposal#Custom_store
OS: Gonk (Firefox OS) → All
Hardware: ARM → All
Results are in a new branch named custom-cache [1] which introduce some changes on the base application [2]. You need to launch the application locally. [1] https://github.com/lodr/v3-app/tree/custom-cache [2] https://github.com/lodr/v3-app/compare/764a1cf058e8b20c7efb84eb6bcce9221babe422
Status: NEW → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
Conclussions are in the repository as well [1] but here is a digest to motivate discussion about the impact on the architecture [2]: 1. The Custom Store approach is useful for A/B testing. 2. Simpler customizations are also feasible following the same schema. 3. Offline Store should be aware of the Custom Store to not keep records for customizations. 4. Render Store should be aware of the Custom Store to invalidate the proper records. 5. The hierarchy Render Store -> Custom Store -> Offline Store has proved to be useful. This investigation had the goal to not simply implement the service worker proposed in the architecture but to probe ServiceWorkerWare possibilities. So, here are some conclussion and points of improvement about it: 6. We need to simplify the route matching algorithm to keep it powerful but predictible. 7. We need a more seamless way of falling through the route rather than forcing middleware developers to add the "work-only-if-no-response-yet" code pattern at the beginning of its code. 8. It would be great to allow modifications both to responses and requests. Notice requests are read-only and some times you want to alter the url for the request (in the Custom Cache I wanted to strip the search part off from the URL). 9. Provide wrappers for request and response to avoid continues cloning and other expensive operations. 10. Encourage REST worker communication by sending HTTP verbs to separated control URLs to not conflict with requests to the Internet or local APIs. [1] https://github.com/lodr/v3-app/blob/custom-cache/conclussions.md [2] https://wiki.mozilla.org/Gaia/Architecture_Proposal
You need to log in before you can comment on or make changes to this bug.