Re: way to write mysqli result set to disk

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, Jan 25, 2006 at 09:51:15PM -0500, PHP Superman wrote:
> couldn't you serialize the data and store it?

you could, but the purpose of my reply to the OT is that there are
other solutions to caching instead of inventing your own

Caching things isn't the simplest of things, consider how much
trouble a browser goes through just to keep a file in its cache,
and how it knows to update the cache. Considering Hitting on
Firefox:

  Refresh button: uses cache files it knows it should cache
  Refresh with Ctrl: requests new versions of files if now new
      version exists, use the cache version
  Refresh with Ctrl-Shft: screw the cache, i want to get 
      everything no matter what.
  
You have to be aware of things like:
  What do i cache:
  - how do i keep track of that
  - where do i store it at
  - what unique filename can i store it in.

  is the data i have stored ok to use
  - when does this data expire
  - how do I know when it expires
  - if I know how when it expires i need to record that somewhere

  I'm using outdated data
  - is the data i have been updated
  - how do I know if there has been a data update
  - how do I keep track of what time i got this data
  - how do I know if there is a change
  - how do you check if it should be updated

  Has the structure changed
  - how do i know a structure has changed
  - ditto everything in expire and outdated sections

Of course there are probaly even more issues that could be
mentioned but, at this point i'm wondering why the query results
are so slow that a self cache system is even needed.

If you can use the databases built in cache method it can save a
lot of headache trying to hack together some code that checks for
data changes against your version, table structure changes against
your version. Not to mention indexing.


Curt.
-- 
cat .signature: No such file or directory

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux