Vol. 1 No. 1 (2026): JULY 2026
Open Access
Peer Reviewed

Smart RESTful API Design with Adaptive Auto-Cache Feature Using Golang and Gin Framework

Authors

dita aulia , Ahmad Rahmatika

Downloads

Received: 2026-05-30
Accepted: 2026-07-10
Published: 2026-07-12

Abstract

The rapid growth of digital applications demands RESTful APIs capable of efficiently handling high request loads. Conventional caching approaches with static Time-to-Live (TTL) values fail to adapt to dynamic user access patterns, resulting in memory inefficiency or uncontrolled performance degradation. This study designs and develops a RESTful API using Golang and the Gin Framework, equipped with a duration-based adaptive auto-cache mechanism. The system implements the formula TTL_runtime = TTL_baseline + AdaptCoeff x D_key, where TTL is dynamically adjusted based on the active duration of each cache key. A monthly evaluation cycle identifies hot keys through three pillars: daily first access time (Pillar 1), cache hit count (Pillar 2), and total active duration as SuggestedTTL (Pillar 3). Testing results demonstrate that the adaptive cache successfully reduced the maximum response time by 68.8%, from 711 ms to 222 ms, with hit ratios reaching 99.83%-99.95% across all traffic intensity variations (200-2,000 requests). Cache misses consistently numbered exactly one per session regardless of request volume, proving the effectiveness of the cache-first mechanism. The monthly evaluation cycle successfully identified 8 hot keys with SuggestedTTL values ranging from 20.4 to 48.6 minutes, proportional to actual usage patterns.

Keywords:

RESTful API Adaptive Auto-Cache Golang Gin Framework Time-to-Live Cache Invalidation

Author Biographies

dita aulia, UNIVERSITAS MUHAMMADIYAH SUMATERA UTARA

Author Origin : Indonesia

Ahmad Rahmatika, Universitas Muhammadiyah Sumatera Utara

Author Origin : Indonesia

How to Cite

dita aulia, & Rahmatika, A. (2026). Smart RESTful API Design with Adaptive Auto-Cache Feature Using Golang and Gin Framework. International Journal of Advanced Reasoning and Computational Intelligence (IJARCI), 1(1), 33–39. Retrieved from https://journal.insitecs.com/index.php/IJARCI/article/view/11