Cross-Domain Caching
Per Buer
perbu at varnish-software.com
Tue Jun 10 08:55:42 CEST 2014
Hi Diego,
On Tue, Jun 10, 2014 at 1:24 AM, Diego Rabatone <diraol at diraol.eng.br>
wrote:
> Hi friends,
>
> I am new at the caching World, and I have looked for some solution to
> cross-domain caching, but I have not found any solution.
>
> I have a blog that embed some dataviz webservices, and I want to cache
> this content that I insert using Iframes.
> The blog is: http://blog.estadaodados.com there is any way of doing this?
>
Absolutely. It is a pretty good way to make sure that the content you embed
performs well in addition to lessening the load on the server you are
embedding content from.
> At this moment I have a Varnish + nginx + php-fpm setup on a dev server
> (not the link that I posted), and it seems to be working ok, but there is
> no caching of the Iframes.
>
No. This is expected. In order to cache those iframes you would need to set
up the server you embedding content from as a backend on your varnish and
preferably give it a new hostname. Then, in the vcl_recv you replace
req.http.host to the original hostname and set the backend. Then regular
caching rules will be applied. In Varnish 4.0 you could set the cache time
to one hour and you could add a keep of maybe a couple of hours. That will
enable IMS so you wouldn't have to refetch the content, only revalidate it.
As James said, should make sure you have the authors permission, but if you
do it through Varnish at least there won't be much of a impact on their
server when you do this.
Cheers,
Per.
--
<http://www.varnish-software.com/> *Per Buer*
CTO | Varnish Software
Phone: +47 958 39 117 | Skype: per.buer
We Make Websites Fly!
Winner of the Red Herring Top 100 Global Award 2013
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://www.varnish-cache.org/lists/pipermail/varnish-misc/attachments/20140610/868ff8d9/attachment.html>
More information about the varnish-misc
mailing list