Icy Phoenix

     
 

What To Cache Or Not?

What To Cache Or Not?

Article
Reply with quote    Download Post  
Post What To Cache Or Not? 
 
Fella's, when a user logs in I cache what I think is required for the session time?

But I also leave things out because I'm unsure if they should be in there anyway?

This is the Dump of the table and I suppose the question is somewhat cryptic, unless I just about explain every column - But any suggestion will give me a better idea?

The XX's are obviously left out.  

What would YOU leave out?

I mean would you add the AIM, YIM and 'other' link info along with occupation and interest's ?  

Spoiler: [ Show ]




 
mort - View user's profile Send private message  
mort [ Mon 29 Dec, 2014 00:53 ]
Icy Phoenix is an open source project, you can show your appreciation and support future development by donating to the project.

Support us


What To Cache Or Not?

Comments
Reply with quote    Download Post  
Post Re: What To Cache Or Not? 
 
Hey.

First off - I don't think you need AIM and YIM fields anymore... Let alone MSN. We're in 2014! I'd just query everything at once, and cache it. You don't pay much for one column, if you're only fetching one record.

Just try to remember that, when the user updates one of them – or if a field can be changed by some admin at some point, you need to clear the cache.



 
Informpro - View user's profile Send private message  
Informpro [ Tue 30 Dec, 2014 03:07 ]
Reply with quote    Download Post  
Post Re: What To Cache Or Not? 
 
Thanks my friend.

Yeah I suppose Yim, MSN, and the rest of the IM's have bit the dust!  along with the manual telephones?

So what replaces it - Skype?

As for the cache, I've just about finished converting my toy from MySQl to PDO and am going to replace the caching script with something better - So I'll read up on the new script to see if it can be sectionalised to not cache everything or if it can be "refreshed or cleared" as required by Submit etc.

A bit of reading and testing to do...



 
mort - View user's profile Send private message  
mort [ Tue 30 Dec, 2014 05:36 ]
Reply with quote    Download Post  
Post Re: What To Cache Or Not? 
 
I guess skype, maybe twitter/facebook field.



 
Informpro - View user's profile Send private message  
Informpro [ Tue 30 Dec, 2014 14:33 ]
Reply with quote    Download Post  
Post Re: What To Cache Or Not? 
 
mort, you are becoming a cache maniac.  



 
Mighty Gorgon - View user's profile Send private message  
Mighty Gorgon [ Sat 10 Jan, 2015 09:08 ]
Reply with quote    Download Post  
Post Re: What To Cache Or Not? 
 
And I'm being driven to complete bloody despair over something else I'm trying to do and I can't see the forest for the trees  

Do you know how to create a workable checkbox array to delete selected items from the Db?

Because I can't seem to throw enough arguments into the DELETE FROM - WHERE so that it doesn't delete every box that's NOT checked... ?  

They'll delete one by one if the column is set to 1 but when I deactivate with another checkbox array/script and set the column as 0 where the theme is disabled it will either remove all but one of the deactivated themes?  

Here's the script...

Spoiler: [ Show ]




 
mort - View user's profile Send private message  
mort [ Sun 11 Jan, 2015 07:33 ]
Reply with quote    Download Post  
Post Re: What To Cache Or Not? 
 
Mighty Gorgon wrote: [View Post]
mort, you are becoming a cache maniac.  


Mmm, Yeah, Well - I downloaded a few caching classes and tried them out and settled on one called RayCache - And it's pretty good.

But! - One can't use it to directly cache the queries - more or less it caches the pages and the queries obviously get added.

But I wanted to cache queries on pages that couldn't all be cached - So I went looking for a "PDO" caching class?

Guess what I found out! PDO with its 'prepared' statements doesn't need to be cached because the data is always available and can be called multiple times without having to make multiple requests..

No wonder I noticed a speed difference once I switched fully to PDO?  

So when is IP going to start using it?  



 
mort - View user's profile Send private message  
mort [ Fri 30 Jan, 2015 02:02 ]
Reply with quote    Download Post  
Post Re: What To Cache Or Not? 
 
Quote:
Guess what I found out! PDO with its 'prepared' statements doesn't need to be cached because the data is always available and can be called multiple times without having to make multiple requests..
No, that's wrong (and doesn't make sense to start with). Only the queries are cached.



 
Informpro - View user's profile Send private message  
Informpro [ Fri 30 Jan, 2015 16:34 ]
Reply with quote    Download Post  
Post Re: What To Cache Or Not? 
 
Informpro wrote: [View Post]
Only the queries are cached.


I think I said that?  

"But I wanted to cache queries on pages that couldn't all be cached."

Maybe I should have said,

But I wanted to cache only the queries on pages that couldn't be cached to add the html also? Because PDO caches the queries anyway.



 
mort - View user's profile Send private message  
mort [ Fri 30 Jan, 2015 22:01 ]
Reply with quote    Download Post  
Post Re: What To Cache Or Not? 
 
Alright, I'll rephrase: only the query *generation* (as in SQL string) *can* be cached. The querying and the results *aren't* cached (unless you do it).



 
Informpro - View user's profile Send private message  
Informpro [ Sat 31 Jan, 2015 22:58 ]
Reply with quote    Download Post  
Post Re: What To Cache Or Not? 
 
I do understand what you are saying - Maybe the whole subject is confusing..  

But this is how I ended up doing it anyway. So the page is cached as html - gZipped and not serialized.

Spoiler: [ Show ]


And this is what we get - Neat! isn't it?  


Spoiler: [ Show ]




 
mort - View user's profile Send private message  
mort [ Sat 31 Jan, 2015 23:20 ]
Display posts from previous:    

HideWas this topic useful?

Post new topic  Reply to topic  Page 1 of 1
 
 




 


 

  cron