0

I need to check md5 checksum of ~10-20 files on server every time a user logs in. Each file can be ~10MB. Should I cache md5 of these files or do it in real-time without wasting time & bothering?

P. S. there will probably be up to 10k logins a day.

Gintas_
  • 4,940
  • 12
  • 44
  • 87

2 Answers2

1

That depends on the requirements, checking a cached value is not the same as getting a file checksum.

So based on the first sentence - I need to check md5 checksum of ~10-20 files - no, you cannot cache it.

However, if you just need to display a checksum, then yes, you can and should cache it and check the file-integrity periodically with a cron-job if necessary.

jeroen
  • 91,079
  • 21
  • 114
  • 132
0

If the files are same for all users, then in that case I would suggest you to cache the md5 of file so that each time you need not to get the file md5 and get it simply from cache.

Dileep Kumar
  • 1,077
  • 9
  • 14