Storing impressions in cache over db

Permalink
Hi,

I have banners on my website that insert an impression into the db every time a page loads. I have 4 on a page and get a lot of traffic. This is slowing down the site.

I have read that you can store data in a cache temporarily then run a script at a quiter time to insert into the database.

Can I do this with the current c5 zend cache or should I use memcache...?

 
JohntheFish replied on at Permalink Reply
JohntheFish
I would keep it separate from any cache c5 uses, because if shared with c5 resources a 'clear cache' could also loose your data.

Easiest would be to simply append rows to a text 'log' file and then run a job to parse that into the database.

Or you could pose the question 'does it really need to be in the database?', write rows to a csv file, swap the file daily or weekly so it doesn't get too big, then analyse the csv files directly and not clutter up the database.

This website stores cookies on your computer. These cookies are used to improve your website experience and provide more personalized services to you, both on this website and through other media. To find out more about the cookies we use, see our Privacy Policy.