( domain: string, env: Env, )
| 174 | * @returns Array of robot rules if found in cache, null otherwise |
| 175 | */ |
| 176 | export async function getCachedRobotsTxt( |
| 177 | domain: string, |
| 178 | env: Env, |
| 179 | ): Promise<RobotsRule[] | null> { |
| 180 | try { |
| 181 | const key = getRobotsTxtCacheKey(domain); |
| 182 | const result = await getFromCache(key, env); |
| 183 | return result as RobotsRule[] | null; |
| 184 | } catch (error) { |
| 185 | console.warn("Failed to retrieve robots.txt from cache:", error); |
| 186 | return null; |
| 187 | } |
| 188 | } |
| 189 | |
| 190 | /** |
| 191 | * Cache robots.txt rules for a domain |
no test coverage detected