Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clean up Engine's caching #45

Open
Zn4rK opened this issue Apr 14, 2024 · 0 comments
Open

Clean up Engine's caching #45

Zn4rK opened this issue Apr 14, 2024 · 0 comments
Labels
engine Navita CSS rendering engine enhancement New feature or request

Comments

@Zn4rK
Copy link
Contributor

Zn4rK commented Apr 14, 2024

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.

@Zn4rK Zn4rK added enhancement New feature or request engine Navita CSS rendering engine labels Apr 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
engine Navita CSS rendering engine enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant