Closed andrewfairlie closed 4 months ago
Is it possible to cache Sprig components to improve their performance?
I mean the ones loaded like
index.php?p=actions/sprig-core/components/render&query=&page=2&sprig%3Aconfig=eb9ce109222fb72cf718be545a0dcc92049549ac06a216b29e2aac26c9552505{"siteId"%3A1%2C"template"%3A"_\%2Fcomponents\%2Fsprig-content\%2Farticles"}
I have the following included URI patterns enabled
And the following query string setting
And the following nginx config
gzip_static on; set $cache_path false; if ($request_method = GET) { set $cache_path /cache/blitz/$host/$uri/$args/index.html; } if ($args ~ "token=") { set $cache_path false; } #- Send would-be 404 requests to the cache path or Craft location / { try_files $cache_path $uri $uri/ /index.php?$query_string; }
Ideally these partials would be cachable in the same way other pages are for peak performance.
5.3.1
No, Sprig requests are never cached, since they are action requests, but you can cache database queries in the Sprig component using Craft’s native cache tags to help reduce their load time.
Support Request
Is it possible to cache Sprig components to improve their performance?
I mean the ones loaded like
I have the following included URI patterns enabled
And the following query string setting
And the following nginx config
Ideally these partials would be cachable in the same way other pages are for peak performance.
Plugin Version
5.3.1