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

Reduce redis calls / use client side caching #15

Open
ankush opened this issue Dec 17, 2024 · 3 comments
Open

Reduce redis calls / use client side caching #15

ankush opened this issue Dec 17, 2024 · 3 comments

Comments

@ankush
Copy link
Member

ankush commented Dec 17, 2024

  • Same data is accessed from multiple caches
  • multiple small shallow cached values are used instead of single "deep" object.
@ankush
Copy link
Member Author

ankush commented Dec 17, 2024

Some "one time" checks need to actually happen one-time on login instead of every request.

@ankush
Copy link
Member Author

ankush commented Dec 26, 2024

get rid of accesses to defaults that aren't necessary ^

@ankush ankush changed the title Optimize authentication related code - reduce redis calls Optimize authentication related code - reduce redis calls / use client side caching Dec 26, 2024
@ankush
Copy link
Member Author

ankush commented Dec 26, 2024

Trace of a single request to get a document

1735214831.248474 [0 127.0.0.1:51954] "GET" "_d9c72a18dc84de7d|installed_app_modules"
1735214831.248910 [0 127.0.0.1:51954] "HGET" "_d9c72a18dc84de7d|session" "33126490bad973e9c9eaa5afbfa285148e0095777b74d7c54ce5786a"
1735214831.249098 [0 127.0.0.1:51954] "GET" "_d9c72a18dc84de7d|document_cache::System Settings::System Settings"
1735214831.249319 [0 127.0.0.1:51954] "GET" "_d9c72a18dc84de7d|document_cache::User::Administrator"
1735214831.249466 [0 127.0.0.1:51954] "HGET" "_d9c72a18dc84de7d|doctype_meta" "User"
1735214831.253509 [0 127.0.0.1:51954] "HGET" "_d9c72a18dc84de7d|doctype_meta" "Has Role"
1735214831.255675 [0 127.0.0.1:51954] "HGET" "_d9c72a18dc84de7d|doctype_meta" "User Social Login"
1735214831.256739 [0 127.0.0.1:51954] "SET" "_d9c72a18dc84de7d|document_cache::User::Administrator" ...
1735214831.257598 [0 127.0.0.1:51954] "HGET" "_d9c72a18dc84de7d|redirect_after_login" "Administrator"
1735214831.257711 [0 127.0.0.1:51954] "GET" "_d9c72a18dc84de7d|app_hooks"
1735214831.257923 [0 127.0.0.1:51954] "HGET" "_d9c72a18dc84de7d|defaults" "__global"
1735214831.258047 [0 127.0.0.1:51954] "GET" "_d9c72a18dc84de7d|recorder-intercept"
1735214831.258218 [0 127.0.0.1:51954] "GET" "_d9c72a18dc84de7d|rate-limit-counter-20083"
1735214831.258428 [0 127.0.0.1:51954] "HGET" "_d9c72a18dc84de7d|doctype_meta" "Control demo"
1735214831.259901 [0 127.0.0.1:51954] "HGET" "_d9c72a18dc84de7d|doctype_meta" "control multi"
1735214831.261086 [0 127.0.0.1:51954] "HGET" "_d9c72a18dc84de7d|last_db_session_update" "33126490bad973e9c9eaa5afbfa285148e0095777b74d7c54ce5786a"
1735214831.261309 [0 127.0.0.1:51954] "RPUSH" "_d9c72a18dc84de7d|monitor-transactions" "..."
1735214831.261883 [0 127.0.0.1:51954] "INCRBY" "_d9c72a18dc84de7d|rate-limit-counter-20083" "3408"
1735214831.261902 [0 127.0.0.1:51954] "EXPIRE" "_d9c72a18dc84de7d|rate-limit-counter-20083" "86400"

@ankush ankush changed the title Optimize authentication related code - reduce redis calls / use client side caching Reduce redis calls / use client side caching Dec 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant