@@ -15,7 +15,7 @@ import type { ORPCContext } from '@/lib/context';
1515import { formatDuration } from '@/utils/formater' ;
1616import { getReadCacheKey } from '@/utils/kv/read-kv-key' ;
1717import { kvPutWithRetry } from '@/utils/kv/retry' ;
18- import { logError } from '@/utils/loggers' ;
18+ import { logDebug , logError } from '@/utils/loggers' ;
1919import {
2020 fixCodeBlockFormatting ,
2121 processMultiLineLinks ,
@@ -161,6 +161,13 @@ export async function processReadRequest(
161161 cacheOptions,
162162 } = params ;
163163
164+ console . log (
165+ '🚀 ~ processReadRequest ~ params' ,
166+ JSON . stringify ( params , null , 2 ) ,
167+ 'isGETRequest' ,
168+ isGETRequest ,
169+ ) ;
170+
164171 let readResponse : ReadResponse | undefined ;
165172 // Initialize cache flag
166173 let isReadCacheFresh = false ;
@@ -195,6 +202,10 @@ export async function processReadRequest(
195202 const oneDayAgo = Date . now ( ) - DEFAULT_KV_CACHE_EXPIRATION_TTL * 1000 ; // 1 day in milliseconds
196203
197204 if ( cacheTimestamp > oneDayAgo ) {
205+ logDebug (
206+ `💽 [READ Endpoint] Found fresh cached read response in KV for ${ targetUrl } ` ,
207+ ) ;
208+
198209 isReadCacheFresh = true ;
199210
200211 if ( isGETRequest ) {
@@ -319,6 +330,10 @@ export async function processReadRequest(
319330 } ,
320331 } ,
321332 ) ;
333+
334+ logDebug (
335+ `💽 [READ Endpoint] Updated read response in KV cache for ${ targetUrl } ` ,
336+ ) ;
322337 } catch ( error ) {
323338 logError ( '[ERROR] Read processor cache write error:' , error ) ;
324339 // Continue without caching if write fails
0 commit comments