Dynamic Caching

You are here:
Estimated reading time: 1 min

If you enable this option you can specify cacheable $_GET and $_POST requests.

Swift Performance does not cache pages with query strings by default, although there are some very specific exceptions.

A query string is where you have a URL that contains a question mark followed by a parameter and a value, like this:


In this case, country is the parameter and portugal is the value.

If you want these types of pages to be cached, go to the Enable Dynamic Caching in settings->Caching->General tab, and add each parameter in the Cacheable Dynamic Requests text field (one per line):

When you do this, a dedicated cache file will be generated for each value the parameter country receives in a URL.

At the moment you can specify keys only, but it should cache only requests which contains one of the specified keys.

We will consider to improve this option to be able to specify key-value pairs (with regex), until this you can use swift_performance_is_cacheable filter to override the default behaviour, for example: https://pastebin.com/Umd8ZQD5

Was this article helpful?
Dislike 0 1 of 1 found this article helpful.