php - Is a Session-Based Cache Solution Viable? -


I am thinking that instead of creating a file-based caching solution, to store cached items in session charges, is feasible? Since it is once per user, this can reduce the database to some additional calls if a user visits more than one page. But is it worth the effort?

"post-text" itemprop = "text">

If you're caching (ready to cache) is not dependent on the user, in the session Why store ... which is related to a user?

Ideas are usually stored in files, it will not be suitable in any type of optimization to use the files themselves.

And if you have 10 users on the site, then you have 10 times the same amount of data in the cache? I do not think this is the best way to cache things - -)

For the same data for all users, I actually go with one more solution, whether this file is based or not (Even for this

Some things that you can see:

    A user, or specific data for a group of users, maybe I do not store it in session Will do -
  • Almost every framework is a type of mechanic For example:
  • You can store cached data using lots of backends. For example:
    • Files
    • Shared Memory (for example, something like)
    • If you have multiple servers and data loaded,
    • >
    • (Some structures provide classes to work with those people; Switching from one to the other can also make it easier to change some rows in the configuration file The next question is what should you do to cache? For how long? But this is another problem, And only you can answer it; -)


Comments

Popular posts from this blog

c# - ListView onScroll event -

PHP - get image from byte array -

Linux Terminal Problem with Non-Canonical Terminal I/O app -