Cache Url with QueryString

Cache Url with QueryString

by admin

By default, WP Fastest Cache does not cache URLs with query string parameters because they can produce dynamic or user-specific content.

For security and cache correctness, every parameter in the URL must be included in the allowlist.

Enable Cache for URLs with Query Strings

If you want to allow specific query string parameters to be cached, you need to add the following line after <?php which exists at the top of wp-config.php file.

define('WPFC_CACHE_QUERYSTRING_PARAMS', 'lang, currency');

Google Analytics Parameters

Google Analytics allows adding campaign parameters to the destination URLs to collect information about the overall efficacy of the campaigns.

If a url contains any google analytics parameters such as utm_source, utm_medium, utm_campaign, utm_term, utm_content, the url is served via main page cache. You don’t need to do any extra action.

Example

https://www.example.com/mypost/?utm_source=summer-mailer&utm_medium=email&utm_campaign=summer-sale

This url is served via the cache of https://www.example.com/mypost/

How To Disable

If you want to disable this feature, you can exclude via “exclude” tab as below.

Yandex Metrica Parameters

If a url contains a query string, the url is not served via cache but the situation is different for the urls which contains Yandex Metrica parameters.

Yandex adds a special parameter – ysclid – to the link when visiting a site from the search results. If a url contains a query string, the url is not served via cache but thanks to this feature, pages are served via the cache for users from Yandex.

If a url contains any Yandex Click Id parameters such as yclid, yadclid or ysclid, the url is served via main page cache. You don’t need to do any extra action.

Example

https://www.example.com/mypost/?ysclid=ksil7dwgjm

This url is served via the cache of https://www.example.com/mypost/

How To Disable

If you want to disable this feature, you can exclude via “exclude” tab as below.

blank

Facebook Click ID Parameters

Facebook Click ID parameters can be added to destination URLs to track visits coming from Facebook and Instagram.

If a URL contains the fbclid parameter, it is served via the main page cache. You don’t need to take any extra action.

Example

https://www.example.com/mypost/?fbclid=summer-mailer

This url is served via the cache of https://www.example.com/mypost/

How to Disable

If you want to disable this feature, you can exclude via “exclude” tab as below.

blank

Related articles

Placeholder Image
How to Serve Cache Only via PHP

On servers using apache, the cache is served via htaccess thanks to the rewrite rule. It is the best method…

How to Move the Menu Item Under the Setting Menu
How to Move the Menu Item Under the Setting Menu

The menu item of WP Fastest Cache is added to the top level menu by default so you can reach…

Placeholder Image
How to Remove the Footer Comment

By default, WP Fastest Cache adds an HTML comment in the page footer that indicates when and for how long…

Ready to get started?

Purchase your first license and see why 1,500,000+ websites globally around the world trust us.