简体   繁体   English

处理oEmbed有关存储和缓存响应的最佳实践是什么?

[英]What are best practices in dealing with oEmbed regarding storing and caching responses?

I'm currently working on a website and I'm fairly new to working with oembed. 我目前正在一个网站上工作,我很擅长与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? 如果最终速度是我的目标,而我正在研究的网站有可能产生大量流量,我最好通过存储端点和媒体网址来保存自己的数据库空间,并在每次需要时运行oEmbed GET加载页面或一旦我有嵌入代码我应该将其存储在我的数据库中? 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? 此外,这里有安全问题吗?

I've gone down the road to store my oembed results in the db. 我已经走了将我的oembed结果存储在数据库中。 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. 我使用embed.ly服务获取我的oembed对象,尽管响应时间通常都很好,缓存db中的响应大大提高了客户端的性能。

I've also setup a service which runs once a day (seems enough) and update the db-cache once a day. 我还设置了一个每天运行一次的服务(似乎已经足够)并且每天更新一次db-cache。

One thing that may become an issue, is getting the oembed with a specified size (eg max-width). 可能成为问题的一件事是使用指定大小(例如最大宽度)获得oembed。 Changing embeded html/flash to another size on-the fly won't be fun... 将embeded html / flash更改为另一个大小的动态将不会很有趣......

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM