views:

16

answers:

1

I'm currently working on a website and I'm fairly new to working with oembed. What are considered best practices in regards to storage and caching of the response? If ultimate speed is my goal and the site I'm working on has potential for huge amounts of traffic, am I better off saving myself database space by just storing the end-point and media urls and running an oEmbed GET every time I need to load a page or once I have the embed code should I store that in my database? I realize there may be other variables to consider but I would appreciate any feedback on things I should be considering in making this decision.

Also, are there security concerns here?

A: 

I've gone down the road to store my oembed results in the db. I use the embed.ly service to get my oembed objects and allthough response times are generally good, caching the responses in the db has greatly increase performance on the client.

I've also setup a service which runs once a day (seems enough) and update the db-cache once a day.

One thing that may become an issue, is getting the oembed with a specified size (e.g. max-width). Changing embeded html/flash to another size on-the fly won't be fun...

AyKarsi