Since Apollo has Apollo Cache for storing local data. I want to store auth token
inside the Apollo cache instead of local storage. By store to Apollo Cache, help me clear auth token
and other caching data when user logout without caring about local storage data.
My question is: Is it OK if I store auth token
in Apollo Cache? Because example of Authentication from Apollo website is using local storage for storing auth token
, this make me confusing.
I decided to store
auth token
inLocal Storage
instead ofApollo Cache
because I made benchmark to measure speed of retrievingtoken
fromLocal Storage
andApollo Cache
,result is: retrieve fromLocal Storage
faster thanApollo Cache
around 3 ~ 4 times