I am on the way with writing small PHP framework, and now I am facing the "mind" issue. The issue is how to handle the user data which is (logged name, logged status) etc. For now while reading many tutorials I have seen only the simple way, like to cache the queries, full HTML output etc. So what do you think, should I cache only the View? So for example load the header that contain user "not sensitive" data, and the footer, and after all checking if the cookie for specific page exists?
Like if user is on the news page and the cache time is 10 minutes, read the full content (View only) from the cached file?
But how to handle the sessions in cached file, which is simple HTML output, I need to prevent that user may see a cached file of different user for some reason (like m5/sha1 hash that been assigned twice), or to save the cache files per user?
What do you think over all, should I only cache the information that need to integrate with database, for example load all news then cache it in file (that the user data is excluded), then load dynamically from the COOKIE/SESSION (the user information / cached file hash id - then load it) ?
Or there is any simple solution / or not simple to handle this? I am not saying to use any PHP Modules, this question been sent to get answer (the best to get a schema of cache system with user data), then I would develop it for myself (also to gain the experience).
Thanks, and I wish you good day! :)