Quantcast
Channel: Web API
Viewing all articles
Browse latest Browse all 4850

Should I use caching or what?

$
0
0

I am having two issues regarding caching.

I am using EF 6. and have a table named like "memberConfig" which has many fields of member like latLng, lastAccessTime, ..

I am writing current time to lastAccessTime field in every api call. like

var memberConfig = db.memberConfig.find(memNo);

memberConfig.lastAccessTime = DateTime.Now;

and there's time when I have to write members' latLng data to theirs latLng field every 10 seconds. and other people access to that latLng data.

As you guess It's kind of tracking someone's position.

I guess caching is better than accessing to database in terms of performance.

I am having an idea about using static variable or static dbcontext without database(Entity framework), or memoryCache, redis.

What's the best practice I should try in short time?

sorry for my english, I am not a native, I am not good at english.


Viewing all articles
Browse latest Browse all 4850

Latest Images

Trending Articles



Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>