Conversation
Retrieving a feed with distinct cURL parameters such as user-agent might give different responses, which should not share the same cache. Follow-up and generalisation of simplepie#643 The code to get the cache filename is extracted in its own new fuction `SimplePie::get_cache_filename($url)` so that clients can easily get this information as well. Downstream PR: FreshRSS/FreshRSS#3502
| // Append custom parameters to the URL to avoid cache pollution in case of multiple calls with different parameters. | ||
| $url .= $this->force_feed ? '#force_feed' : ''; | ||
| $options = array(); | ||
| if ($this->timeout != 10) |
There was a problem hiding this comment.
Those tests are to keep the best possible compatibility with existing cache filenames: if not using custom cURL options, the cache filenames should be unchanged
| if (!empty($options)) | ||
| { | ||
| ksort($options); | ||
| $url .= '#' . urlencode(var_export($options, true)); |
There was a problem hiding this comment.
The modified URL is still a valid URL, in case a custom cache_name_function() might have such an expectation
|
could this be optional? I don't feel that changing your agent necessarily means you want to cache both versions, but this is enforcing it. I think you will also need to move |
<?php
$url = 'https://example.net/#one#two#three';
print_r(parse_url($url)); |
|
ok fair enough, I was thinking caches might grow unexpectedly from this change but that's really only a problem if you're changing the agent options a lot. thanks for the update! |
Retrieving a feed with distinct cURL parameters such as user-agent might give different responses, which should not share the same cache.
Follow-up and generalisation of #643
The code to get the cache filename is extracted in its own new function
SimplePie::get_cache_filename($url)so that clients can easily get this information as well.Downstream PR: FreshRSS/FreshRSS#3502