You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@rednaks have you thought about retrieving the geolocation from the cookie so that we don't need to call the API every single request?
Use case: a typical user will visit multiple pages per site and it's very unlikely their geolocation will change on every request. But calling the API on every single request can be changed to only when the cookie doesn't exist.
The text was updated successfully, but these errors were encountered:
what do you actually mean by take if from the cookies ?
Your description sounds to me like you want a cache for the geolocation data. I already opened an issue for that you can check #10 but I'm wondering, do you use cache cause still have no idea how to implement something that would be generic for everyone, even those who don't use a django cache ...
yea kinda like cache but mostly not using cookies as data storage
User have to add this in settings:
ENABLE_COOKIE = True (has to be true for cache to work)
CACHE_IN_COKKIE = True
The flow will look this:
START
┣ User makes a request
┣ Check IF the user has geolocation in a cookie and is not older than 15 days
┃ ┗ YES: Use the geolocation from the cookie and no API calls made
┃ ┗ NO: Call the API from one of the backends and create the cookie as per process_response function
END
@rednaks have you thought about retrieving the
geolocation
from the cookie so that we don't need to call the API every single request?Use case: a typical user will visit multiple pages per site and it's very unlikely their geolocation will change on every request. But calling the API on every single request can be changed to only when the cookie doesn't exist.
The text was updated successfully, but these errors were encountered: