From #974350-69: Far Future setting for Origin Pull mode:

- A way to check that the css url() reference will be a far-future CDN url & what type it will be (version number, core, md5, mtime).
- API to see if that file has changed according to the rules; I will store the previous state, so doing a string comparison of the url is all I need most likely.
- A way to have CDN output relative URLs instead of absolute URLs (nice to have, also help with string comparison). I just might strip off the hostname and call it good for string comparison.
- API call to make sure the url for image.png is changed when it gets processed in the CDN module (if using caching) (md5 or mtime mode).

Comments

Wim Leers’s picture

Version: 6.x-2.x-dev » 7.x-2.x-dev
Status: Active » Postponed

Postponing until somebody pings me because it is actually going to be used. No point in providing an API nobody uses.

Wim Leers’s picture

Not quite the requested ones yet, but a subset are part of #1428530-13: Override CSS aggregation to ensure correct file URL altering for files referenced by CSS files:

/**
 * Check if the current protocol is supported by the CDN.
 *
 * Note: currently only checks HTTPS, in the future possibly also SPDY.
 */
function cdn_check_protocol() {}
/**
 * Check if a Drupal path should serve files from the CDN (i.e.: is the Drupal
 * path blacklisted?).
 *
 * @param $path
 *   A Drupal path.
 */
function cdn_check_drupal_path($path) {}

D6:

/**
 * Check if a file should be served from the CDN.
 *
 * @param $path
 *   Path to a file; relative to the Drupal root directory.
 */
function cdn_check_file($path) {}

D7:


/**
 * Check if a file should be served from the CDN.
 *
 * @param $uri
 *   A file URI.
 */
function cdn_check_file($uri) {}
Wim Leers’s picture

In #1452074: CDN module takes over CSS aggregation even when its status is disabled, a public cdn_status_is_enabled() function was added.

Wim Leers’s picture

In #1515392: UFI mapping not correctly applied (fix + unit tests), a public cdn_basic_farfuture_get_ufi_method() function was added (implements second half of first requirement in OP).

Wim Leers’s picture

Version: 7.x-2.x-dev » 8.x-3.x-dev
Issue summary: View changes
Wim Leers’s picture

Status: Postponed » Fixed

The code is much, much, much simpler in the Drupal 8 port of the CDN module. Just override the cdn.file_url_generator/Drupal\cdn\File\FileUrlGenerator service and do whatever you please.

Wim Leers’s picture

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.