code100x/cms

Tech backlog | Singleton implementation of Cache

Closed this issue · 0 comments

What is the purpose of this issue ?

  • Chore | Improve Singleton implementation for Cache.
  • Note: This is not a bug, it's a chore.

Value addition ?

  • Does it add any feature or fix any bug in the application ? > No.
  • Does it improve performance of the application ? > Probably not.
  • Does it improve code quality and maintainability ? > Yes.

What is this really about ?

Cache is implemented as a Singleton. The Cache.getInstance() is called frequently ( 27 times to be precise) in a lot of places unnecessarily.

Instead, we should directly export Cache.getInstance() which points to the singleton instance.