@@ -486,7 +486,7 @@ protected function processMiddleware(Route $route, string $eventName): bool
486486 // Which loosely translates to $class->$method($params)
487487 $ start = microtime (true );
488488 $ middlewareResult = $ middlewareObject ($ params );
489- $ this ->triggerEvent ('flight.middleware.executed ' , $ route , $ middleware , microtime (true ) - $ start );
489+ $ this ->triggerEvent ('flight.middleware.executed ' , $ route , $ middleware , $ eventName , microtime (true ) - $ start );
490490
491491 if ($ useV3OutputBuffering === true ) {
492492 $ this ->response ()->write (ob_get_clean ());
@@ -1002,10 +1002,10 @@ public function _etag(string $id, string $type = 'strong'): void
10021002
10031003 $ this ->response ()->header ('ETag ' , '" ' . str_replace ('" ' , '\" ' , $ id ) . '" ' );
10041004
1005- if (
1006- isset ( $ _SERVER [ ' HTTP_IF_NONE_MATCH ' ]) &&
1007- $ _SERVER [ ' HTTP_IF_NONE_MATCH ' ] === $ id
1008- ) {
1005+ $ hit = isset ( $ _SERVER [ ' HTTP_IF_NONE_MATCH ' ]) && $ _SERVER [ ' HTTP_IF_NONE_MATCH ' ] === $ id ;
1006+ $ this -> triggerEvent ( ' flight.cache.checked ' , ' etag ' , $ hit , 0.0 );
1007+
1008+ if ( $ hit === true ) {
10091009 $ this ->response ()->clear ();
10101010 $ this ->halt (304 , '' , empty (getenv ('PHPUNIT_TEST ' )));
10111011 }
@@ -1020,10 +1020,10 @@ public function _lastModified(int $time): void
10201020 {
10211021 $ this ->response ()->header ('Last-Modified ' , gmdate ('D, d M Y H:i:s \G\M\T ' , $ time ));
10221022
1023- if (
1024- isset ( $ _SERVER [ ' HTTP_IF_MODIFIED_SINCE ' ]) &&
1025- strtotime ( $ _SERVER [ ' HTTP_IF_MODIFIED_SINCE ' ]) === $ time
1026- ) {
1023+ $ hit = isset ( $ _SERVER [ ' HTTP_IF_MODIFIED_SINCE ' ]) && strtotime ( $ _SERVER [ ' HTTP_IF_MODIFIED_SINCE ' ]) === $ time ;
1024+ $ this -> triggerEvent ( ' flight.cache.checked ' , ' lastModified ' , $ hit , 0.0 );
1025+
1026+ if ( $ hit === true ) {
10271027 $ this ->response ()->clear ();
10281028 $ this ->halt (304 , '' , empty (getenv ('PHPUNIT_TEST ' )));
10291029 }
0 commit comments