Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Great module. I needed to be able to selectively warm the cache with specifically set headers, e.g. for different mobile caches
I added an additional command line switch to allow setting/overriding the CURL initialization parameters
--add-curl-params="my_overrides.php"
The additional curl params should be in this form:
function cache_warmer_get_additional_curl_params() {
return array(
CURLOPT_USERAGENT => 'iPad',
);
}
This is all tested and working great. Please consider rolling into this module.
Comment | File | Size | Author |
---|---|---|---|
#3 | add_curl_param_overrides-1515790-3.patch | 2.11 KB | beebop_cj |
#1 | add_curl_param_overrides-1515790-2.patch | 15.23 KB | craigmc |
Comments
Comment #1
craigmc CreditAttribution: craigmc commentedPatch file attached here.
Comment #2
beebop_cj CreditAttribution: beebop_cj commentedHey Craig.
I've been having a similar issue in which I needed to cache https pages but we have only self signed certificates on our test environments. Therefore it required a new curl option: CURLOPT_SSL_VERIFYPEER => FALSE.
The idea I had was to create a hook and each hook would return an array of cURL parameters.
The code comes right after the basic options definition:
Here is the code:
A hook implementation would look like this:
Will post the patch (maybe it's helpful for someone) in the next comment for consistency with comment-patch numbering (#2 was taken).
Cheers,
Marius
Comment #3
beebop_cj CreditAttribution: beebop_cj commentedPosted the patch.
Marius