No way to tweak the cache parameters of an oembed request

Created on 12 April 2012, almost 13 years ago
Updated 26 November 2024, 4 months ago

oembedcore.module allows you to change an oembed request before it goes out (hook_oembed_request_alter), but the cache properties are difficult to change because there's no point where you can alter the oembedcore_render_cache object. For example, if I wanted to set oembed API request caches to CACHE_PERMANENT, I really have no good way of doing that.

If I want to force cache lifetimes on the embed markup cache or the thumbnail, then I can add a decorator to media_oembed_file_formatter_media_oembed_view to do that, but the same isn't true of the actual outgoing API request.

There is a variable that can be set to increase cache lifetimes when not set, but I can't set CACHE_PERMANENT there, because the value is added to REQUEST_TIME, not taken as absolute.

There are also cases where you would want to manipulate the cache keys.

The attached patch aims to make these elements alterable.

✨ Feature request
Status

Closed: outdated

Version

0.0

Component

Code

Created by

πŸ‡©πŸ‡ͺGermany Alan Evans

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • πŸ‡ΊπŸ‡¦Ukraine AstonVictor

    I'm closing it because the issue was created a long time ago without any further steps.

    if you still need it then raise a new one.
    thanks

Production build 0.71.5 2024