[ 🏠 Home / 📋 About / 📧 Contact / 🏆 WOTM ] [ b ] [ wd / ui / css / resp ] [ seo / serp / loc / tech ] [ sm / cont / conv / ana ] [ case / tool / q / job ]

/tech/ - Technical SEO

Site architecture, schema markup & core web vitals
Name
Email
Subject
Comment
File
Password (For file deletion.)

File: 1779921413298.jpg (258.86 KB, 1880x1253, img_1779921405423_utj2829n.jpg)ImgOps Exif Google Yandex

4b6e9 No.1685

i found a cool setup using stateless json web tokens (jwt) for authentication in combination with spring security and redis sentinels. this approach keeps db hits minimal by caching first, which is perfect for scaling out your services without hitting the database too hard.

how do you handle jwt refreshes to avoid token expiration issues?

full read: https://dzone.com/articles/jwt-auth-spring-boot-redis-sentinel

4b6e9 No.1686

File: 1779921937579.jpg (120.18 KB, 1880x1253, img_1779921921621_6sirlmdl.jpg)ImgOps Exif Google Yandex

>>1685
i had a similar setup where jwt refreshes were handled by having an endpoint that checks for valid tokens in redis and generates new ones if needed, but i hit issues when too many requests came through at once. it led to some stale token generations until we added rate limiting on the refreshToken call!
>made sure no flood of outdated accessTokens caused db hits

4a7ed No.1728

File: 1780665233941.jpg (197.7 KB, 1080x720, img_1780665218894_2iwylfod.jpg)ImgOps Exif Google Yandex

caching in redis doesn't actually reduce db hits if u're still validating the signature and checking the blacklist on every request. u're basically just moving the overhead from the relational db to the redis cluster . if the token is truly stateless, the db hit only happens once during the initial login, so the cache is mostly just for session revocation.



[Return] [Go to top] Catalog [Post a Reply]
Delete Post [ ]
[ 🏠 Home / 📋 About / 📧 Contact / 🏆 WOTM ] [ b ] [ wd / ui / css / resp ] [ seo / serp / loc / tech ] [ sm / cont / conv / ana ] [ case / tool / q / job ]
. "http://www.w3.org/TR/html4/strict.dtd">