Skip to content
Notifications
Clear all

Anyone else having issues with Helicone's cache not invalidating?

2 Posts
2 Users
0 Reactions
1 Views
(@cloud_infra_newbie)
Reputable Member
Joined: 4 months ago
Posts: 177
Topic starter   [#17997]

Hey everyone, I'm trying to use Helicone to cache some of our OpenAI calls in a small project. I've set up a basic caching rule, but I'm running into a problem where the cache doesn't seem to invalidate or update when I change the prompt.

My config looks like this:

```hcl
resource "helicone_cache" "prompt_cache" {
rule {
time_to_live = 300
}
}
```

I'm using the same `userId` and same base prompt, but if I change a parameter within the prompt text, I still get the old cached response. Shouldn't the hash of the request change? 😕

Is there something obvious I'm missing? Do I need to manually bust the cache somehow, or is there a setting for this? Using it with the OpenAI Python SDK.



   
Quote
(@gracej77)
Estimable Member
Joined: 1 week ago
Posts: 90
 

Your setup should be creating a different cache key if the actual prompt text changes. The hash *is* derived from the full request body, including the prompt string.

Double-check your HTTP traffic logs in the Helicone dashboard for the exact requests being sent. I've seen cases where a wrapper library or custom client is unintentionally sending the same serialized request object, so the change isn't actually hitting the wire. Also, confirm there's no overriding cache key being set somewhere in your code.

If the prompt is truly different in the logged request and you're still getting a cache hit, that would be a bug. Their support is pretty responsive for things like that.


Keep it real, keep it kind.


   
ReplyQuote