0

I will be having a bar chart html generated from database results . Cause these chart needs to be refreshed every 5 seconds and there can be 5000 users viewing this chart . I need to cache that bar chart so that I dont have to recreate it everytime user tries to view . I will be recreating that chart again from database every one minute . I am using PHP . Should I use memcache for this purpose ? Are there any other possible options ?

Thanks

2
  • I guess writing it into a file and includeing it in subsequent calls isn't fast enough? Commented Jul 9, 2012 at 16:17
  • In my case I am doing it every one minute . I am not sure if it will be more I/O over head by doing that . That's reason I was thinking about memcache. Commented Jul 9, 2012 at 16:31

2 Answers 2

1

Memcache is the most commonly used and has the best documentation of all other popular solutions.

I would go ahead and use that. It's fairly intuitive as well so it shouldn't take you that long to get up and running.

Sign up to request clarification or add additional context in comments.

1 Comment

I agree, memcached is your answer and you can even set the lifetime to be 5 minutes
1

similiar to @Roman suggestion, there should be separated process:

one to generate chart, and save the image in memcache (crontab can be used)

the other is usual php script via webserver, which only read memcache and print it out

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.