Return a cacheable response from TimezoneController
1 unresolved thread
Compare changes
@@ -2,7 +2,8 @@
@@ -23,15 +24,19 @@ class TimezoneController {
@@ -39,15 +44,20 @@ public function getTimezone($abbreviation = '', $offset = -1, $is_daylight_savin
This part is the only thing I'm not sure about, seems to be addressing another issue maybe?
It is addressing a different issue, but it's somewhat a prerequisite to get caching to work.
Without this,
$is_daylight_saving_time
can beNULL
when it is passed totimezone_name_from_abbr
. As of PHP 8, this will generate a deprecation notice. And, depending on the current settings, a PHP notice will add a message toMessenger
which will trigger the page cacheKillSwitch
(seeMessenger::addMessage
).So, while the controller can return a cacheable response without this change, the response will likely not end up getting cached due to the PHP notice.