Google Maps Onebox data is not cached

I think you are totally misunderstanding how we use the onebox gem in Discourse.

https://github.com/discourse/discourse/blob/master/lib/oneboxer.rb#L147

In fact if you look at the actual backend code you will notice that we never use the built-in moneta cache thingy in the onebox gem.

In fact, my vote here is that we should just nuke the moneta dependency and dump cache logic built into the onebox gem and have consumers be in charge of it.

As to “allowing origin to participate in caching decisions”, well who knows, maybe an interface can be added that allows providers to pass that information on.

Regardless, Discourse uses a “dumb” cache that caches all oneboxes for 1 day unless you rebake a post or force the cache invalidation.

2 Likes