Clean up Engine's caching
Opened this issue · 0 comments
Zn4rK commented
As I almost mentioned in #43, the caching mechanism we're using right now, always assumes in-memory usage.
This works very well as it is right now, but the way the code is structured could be better. If we reach for a more flat structure, it would be easier to expand/replace to another type of persistent storage later. Right now we're also pretty inefficient in the way we are storing data for the cache
Here's an example entry:
"{\"type\":\"rule\",\"selector\":\"\",\"property\":\"padding\",\"value\":\"20px\",\"pseudo\":\"\",\"media\":\"\",\"support\":\"\",\"container\":\"\"}": {
"id": "b1",
"type": "rule",
"selector": "",
"property": "padding",
"value": "20px",
"pseudo": "",
"media": "",
"support": "",
"container": ""
},
The key is the value, just stringified, and without the id.