views:

18

answers:

2

I have a symfony website running on the standard LAMP setup.

I need to store about 400 bytes (the result of a JSON query, actually). the result for this query fails often (out of my hands). I want to cache this somehow. what is the easiest, cleanest, lightest way to do this?

I have a MySQL database that's being used by my models, so I could hypothetically use this. but is there a simpler way that I don't know about?

+1  A: 

You can use memcached. The biggest thing you need to remember is that it's a cache, and you should be able to cope with it expiring at any time.

There are many tutorials and books available.

Matthew Flaschen
thats what I'm thinking, actually. just wanted to see if there is anything else :)
Oren Mazor
+1  A: 

Well you could write it to a file!.

$dmp = fopen ("c:\temp\dumpquery" . time() . ".txt", "w');
fwrite ($dmp,$yourquery);
fclose($dmp);
James Anderson
this feel inelegant :)
Oren Mazor
True, it fulfils the "easiest" adn "lightest" criteria, but its perhaps not the most elegent solution.
James Anderson