Skip to content

Conversation

@slavaGanzin
Copy link
Contributor

@slavaGanzin slavaGanzin commented Nov 27, 2025

There is 1 hour TTL for cache, and when I release a new version I want to refresh the cache

claude and others added 3 commits November 27, 2025 11:24
Added configurable cache TTL to address stale version caching in containerized deployments:
- Added CacheTTL duration field to Config struct (configurable via CACHE_TTL env var)
- Updated cache logic to use configurable TTL instead of hardcoded 1-hour constant
- Added /clearcache endpoint for manual cache invalidation
- Cache can be disabled entirely by setting CacheTTL to 0
- Default TTL remains 1 hour for backwards compatibility

Changes made:
- Modified handler/config.go: added CacheTTL field with time.Duration type
- Modified handler/handler.go: removed cacheTTL constant, added /clearcache endpoint
- Modified handler/handler_execute.go: updated execute() to use Config.CacheTTL
- All tests pass successfully

PROMPT: Hey when a repo releases is updated, it still installs previous versions, and I need to restart a container, so do you know what to do about it?
Removed configurable cache TTL configuration in favor of simpler solution:
- Removed CacheTTL field from Config struct
- Restored hardcoded 1-hour cache TTL constant
- Kept /clearcache endpoint for manual cache invalidation

Changes made:
- Modified handler/config.go: removed CacheTTL field and time import
- Modified handler/handler.go: restored cacheTTL constant, kept /clearcache endpoint
- Modified handler/handler_execute.go: reverted to use cacheTTL constant
- All tests pass successfully

PROMPT: hey cut out CACHE_TTL, just leave the /clearcache
@jpillora
Copy link
Owner

I think id prefer an env var to configure cache, down to 0, no cache; rather than a clear cache endpoint anyone can hit

@slavaGanzin
Copy link
Contributor Author

Yeah, the first commit actually had this implementation, but then I thought that even though it can be called by anyone, it is still less vulnerable than setting CACHE_TTL to 0. Because if you do that, you could easily DDoS the installer when it fetches repeatedly from GitHub. On the other hand, with 90%, you would have a proxy in front of the installer, and you could limit that endpoint to the internal network or VPN, or not open it to the public. And adding an auth layer is definitely not within the scope of an installer, so it should be handled by other layer. But this endpoint probably should be configurable

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants