Skip to content

Instantly share code, notes, and snippets.

@adamcrampton
Created September 30, 2019 02:28
Show Gist options
  • Save adamcrampton/8d2ebad0af5a5fb98c91249325ef1c69 to your computer and use it in GitHub Desktop.
Save adamcrampton/8d2ebad0af5a5fb98c91249325ef1c69 to your computer and use it in GitHub Desktop.
Handy array useful for configuring cache TTLs etc
<?php
/*
|--------------------------------------------------------------------------
| Cache TTL
|--------------------------------------------------------------------------
|
| Set commonly used TTL values.
|
*/
return [
// Cache store type.
'apc' => [
'default' => 86400
],
'array' => [
'default' => 86400
],
'database' => [
'default' => 86400
],
'file' => [
'default' => 86400
],
'memcached' => [
'default' => 86400
],
'redis' => [
'default' => 86400
],
// Handy values.
'minutes' => [
'one' => 60,
'five' => 300,
'ten' => 600,
'fifteen' => 900,
'twenty' => 1200,
'thirty' => 1800,
'forty' => 2400,
'fortyFive' => 2700,
'fifty' => 3000,
'sixty' => 3600
],
'hours' => [
'one' => 3600,
'two' => 7200,
'three' => 10800,
'four' => 14400,
'five' => 18000,
'six' => 21600,
'seven' => 25200,
'eight' => 28800,
'nine' => 32400,
'ten' => 36000,
'eleven' => 39600,
'twelve' => 43200,
'twentyFour' => 86400
],
'days' => [
'one' => 86400,
'two' => 172800,
'three' => 259200,
'four' => 345600,
'five' => 432000,
'six' => 518400,
'seven' => 604800,
'fourteen' => 1209600,
'twentyEight' => 2419200
],
'weeks' => [
'one' => 604800,
'two' => 1209600,
'three' => 1814400,
'four' => 2419200,
'five' => 3024000,
'six' => 3628800
]
];
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment