-
Notifications
You must be signed in to change notification settings - Fork 10
Description
i have configured 'strapi-cache' plugin for in-memory caching, and cacheable routes i have kept empty to cache all the routes, i tried using ['/api/', '/api/*] but none is working as expected.
"strapi-cache": { enabled: true, config: { debug: true, max: 2000, ttl: 60 * 60 * 1000, size: 512 * 1024 * 1024, allowStale: true, cacheableRoutes: [], provider: "redis", redisConfig: { url: env("REDIS_URL", "redis://localhost:6379"), keyPrefix: "strapi:cache:", maxRetriesPerRequest: 3, connectTimeout: 5000, commandTimeout: 3000, }, }, },
what is happening is if i hit on my api key which is => http://localhost:1337/api/pre-footer?populate=* , i get MISS everytime i hit this api, which shouldn't happer as plugin has been configured, and MISS should come only for the first time
below is the response from redis-cli for your reference
PS C:\Users\baps> redis-cli
127.0.0.1:6379> GET strapi:cache:GET:/api/pre-footer?populate=*
"{\"body\":{\"data\":{\"id\":16,\"documentId\":\"zg54a05oy7liizgke9c59reg\",\"createdAt\":\"2025-06-24T07:05:29.725Z\",\"updatedAt\":\"2025-07-01T08:11:10.959Z\",\"publishedAt\":\"2025-07-01T08:11:12.647Z\",\"left\":{\"id\":16,\"aboutCEO\":{\"id\":16,\"heading\":\"CEO Journey\",\"cards\":[{\"id\":46,\"description\":\"<p>Started in 2013 as a <strong>self-taught developer</strong>, now leading a <strong>20+ member team</strong>.</p>\",\"logo\":null},{\"id\":47,\"description\":\"<p><strong>Built long-term partnerships</strong> with US brands like <strong>Convoso</strong>.</p>\",\"logo\":null},{\"id\":48,\"description\":\"<p><strong>Empowered 100+ businesses</strong> \xe2\x80\x94 from local SMBs to funded startups and US enterprises.</p>\",\"logo\":null}],\"CEOImage\":null},\"enterprises\":{\"id\":16,\"heading\":\"Trusted by Enterprises Across World\",\"images\":null},\"googlePartner\":{\"id\":16,\"heading\":\"Anglara Partner with Google Communities\",\"images\":null}},\"right\":{\"id\":22,\"freeCall\":{\"id\":22,\"link\":\"https://calendly.com/anglara/free-consultation-call\",\"buttonHeading\":\"Book Free Call\"},\"freeTrial\":{\"id\":22,\"title\":\"Book Your Free Trial Today.\",\"fields\":[{\"type\":\"text\",\"label\":\"Your Name\",\"required\":true,\"placeholder\":\"Enter your name\"},{\"type\":\"email\",\"label\":\"Email\",\"required\":true,\"placeholder\":\"Enter your email\"},{\"type\":\"textarea\",\"label\":\"Project Details\",\"required\":false,\"placeholder\":\"Share some details about the project\"}],\"buttonHeading\":\"Book Free Trial\",\"submitButtonText\":{\"id\":30186,\"name\":\"Let\xe2\x80\x99s Work Together\",\"link\":\"#\",\"backgroundColor\":null,\"eyebrowText\":null}}}},\"meta\":{}},\"headers\":{\"content-security-policy\":\"connect-src 'self' https:;img-src 'self' data: blob: dl.airtable.com anglara-strapi-bucket.s3.us-east-1.amazonaws.com;media-src 'self' data: blob: dl.airtable.com anglara-strapi-bucket.s3.us-east-1.amazonaws.com;default-src 'self';base-uri 'self';font-src 'self' https: data:;form-action 'self';frame-ancestors 'self';object-src 'none';script-src 'self';script-src-attr 'none';style-src 'self' https: 'unsafe-inline'\",\"referrer-policy\":\"no-referrer\",\"strict-transport-security\":\"max-age=31536000; includeSubDomains\",\"x-content-type-options\":\"nosniff\",\"x-dns-prefetch-control\":\"off\",\"x-download-options\":\"noopen\",\"x-frame-options\":\"SAMEORIGIN\",\"x-permitted-cross-domain-policies\":\"none\",\"vary\":\"Origin\",\"access-control-allow-origin\":\"\",\"access-control-allow-credentials\":\"true\",\"content-type\":\"application/json; charset=utf-8\",\"x-powered-by\":\"Strapi <strapi.io>\"}}"
127.0.0.1:6379>