Skip to content

Commit

Permalink
More doc
Browse files Browse the repository at this point in the history
  • Loading branch information
Alkarex committed Sep 15, 2024
1 parent 0c7c435 commit af830e1
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 10 deletions.
6 changes: 4 additions & 2 deletions src/HTTP/Utils.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,10 @@ final class Utils
*
* @param array<string,mixed> $http_headers HTTP headers of the response
* @param int $cache_duration Desired cache duration in seconds, potentially overriden by HTTP response headers
* @param int $cache_duration_min Minimal cache duration (in seconds), overriding HTTP response headers `Cache-Control: max-age` and `Expires`
* @param int $cache_duration_max Maximal cache duration (in seconds), overriding HTTP response headers `Cache-Control: max-age` and `Expires`
* @param int $cache_duration_min Minimal cache duration (in seconds), overriding HTTP response headers `Cache-Control: max-age` and `Expires`,
* but without effect on `Cache-Control: no-store` and `Cache-Control: no-cache` and `Cache-Control: must-revalidate`
* @param int $cache_duration_max Maximal cache duration (in seconds), overriding HTTP response headers `Cache-Control: max-age` and `Expires`,
* but without effect on `Cache-Control: no-store` and `Cache-Control: no-cache`
* @return int The negociated cache expiration time in seconds since the Unix Epoch
*
* FreshRSS
Expand Down
17 changes: 9 additions & 8 deletions src/SimplePie.php
Original file line number Diff line number Diff line change
Expand Up @@ -516,17 +516,17 @@ class SimplePie
public $cache_duration = 3600;

/**
* @var int Minimal cache duration (in seconds), overriding HTTP response headers `Cache-Control: max-age` and `Expires`.
* But no effect on `Cache-Control: no-store` and `Cache-Control: no-cache`
* @var int Minimal cache duration (in seconds), overriding HTTP response headers `Cache-Control: max-age` and `Expires`,
* but without effect on `Cache-Control: no-store` and `Cache-Control: no-cache` and `Cache-Control: must-revalidate`
* @see SimplePie::set_cache_duration()
* @access private
* FreshRSS
*/
public $cache_duration_min = 60;

/**
* @var int Maximal cache duration (in seconds), overriding HTTP response headers `Cache-Control: max-age` and `Expires`.
* But no effect on `Cache-Control: no-store` and `Cache-Control: no-cache`
* @var int Maximal cache duration (in seconds), overriding HTTP response headers `Cache-Control: max-age` and `Expires`,
* but without effect on `Cache-Control: no-store` and `Cache-Control: no-cache`
* @see SimplePie::set_cache_duration()
* @access private
* FreshRSS
Expand Down Expand Up @@ -1007,12 +1007,13 @@ public function force_cache_fallback(bool $enable = false)
* Set the length of time (in seconds) that the contents of a feed will be
* cached
*
* FreshRSS: Note that the cache is (partially) HTTP compliant,
* so minimum and maximum parameters have no effect on `Cache-Control: no-store` and `Cache-Control: no-cache`
* FreshRSS: The cache is (partially) HTTP compliant, with the following rules:
*
* @param int $seconds The feed content cache duration, which may be overriden by HTTP response headers)
* @param int $min The minimun cache duration (default: 60s), overriding HTTP response headers `Cache-Control: max-age` and `Expires`
* @param int $max The maximum cache duration (default: 24h), overriding HTTP response headers `Cache-Control: max-age` and `Expires`
* @param int $min The minimun cache duration (default: 60s), overriding HTTP response headers `Cache-Control: max-age` and `Expires`,
* but without effect on `Cache-Control: no-store` and `Cache-Control: no-cache` and `Cache-Control: must-revalidate`
* @param int $max The maximum cache duration (default: 24h), overriding HTTP response headers `Cache-Control: max-age` and `Expires`,
* but without effect on `Cache-Control: no-store` and `Cache-Control: no-cache`
* @return void
*/
public function set_cache_duration(int $seconds = 3600, ?int $min = null, ?int $max = null)
Expand Down

0 comments on commit af830e1

Please sign in to comment.