Skip to content

Commit

Permalink
Promoted the stale-while-revalidate and stale-if-error directives
Browse files Browse the repository at this point in the history
  • Loading branch information
rosell-dk committed Jan 7, 2019
1 parent 6bf5ad2 commit 84dc781
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
2 changes: 1 addition & 1 deletion lib/classes/Config.php
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ public static function getDefaultConfig($skipQualityAuto = false) {

// serve options
'cache-control' => 'no-header', /* can be "no-header", "set" or "custom" */
'cache-control-custom' => 'private, max-age:3600',
'cache-control-custom' => 'public, max-age:86400, stale-while-revalidate=604800, stale-if-error=604800',
'cache-control-max-age' => 'one-week',
'cache-control-public' => false,
'fail' => 'original',
Expand Down
7 changes: 5 additions & 2 deletions lib/options/options/serve-options/cache-control.inc
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,11 @@ $cacheControlPublic = $config['cache-control-public'];

<tr>
<th scope="row">Cache-Control header <?php echo helpIcon(
'Controls the cache-control header on successful conversion and direct redirection to converted ' .
'image in .htaccess. In case of convert failure, headers will be sent to prevent caching. ');
'<p>Controls the cache-control header on successful conversion and direct redirection to converted ' .
'image in .htaccess. In case of convert failure, headers will be sent to prevent caching.</p>' .
'<p>PS: In order to set <i>stale-while-revalidate</i> and <i>stale-if-error directives<i>, you must ' .
'currently choose "Custom". <a target="_blank" href="https://www.fastly.com/blog/stale-while-revalidate-stale-if-error-available-today">It is a good idea to set these</a>.' .
'</p>');
?>
</th>
<td>
Expand Down

0 comments on commit 84dc781

Please sign in to comment.