Exclude part of page from fastcgi_cache (AdRotate Pro WP Plugin)

Hi!

I’m using EasyEngine with WordPress and fastcgi_cache. Have set it up with W3 Total Cache, but with Page Cache off. Also using the Pagespeed module.

On the site I’m using the Adrotate Pro Plugin for WordPress (https://ajdg.solutions/products/adrotate-for-wordpress/), to be able to schedule my different ads to a max number of views per day. This because I have campaigns running for a certain period, and the advertisers only wants a maximum number of views per day.

Problem is, I don’t know how to exclude the Adrotate Pro part of a page from fastcgi_cache. According to the plugin developer, the caching prevents the php code that executes the count views function to work properly (see support thread here).

So, to be clear: The problem is that Adrotate Pro won’t count the ad views properly, and thus not stopping the ad display at the daily threshold.

Is there a way to specify for instance a div with a certain class or ID to be excluded from the fastcgi_cache? This way, I think the counting would work…

Thanks!

// Jens.

i don’t know of any way to make fastcgi-cache be partial page caching. the way it works, that idea doesn’t even make sense.

i don’t know what all features you are making use of with adrotate pro, but i use this: https://wordpress.org/plugins/ads-by-datafeedrcom/ to rotate ads and count impressions. by making use of the javascript feature that it offers, it inserts ads and counts impressions using a little bit of js code that it injects into the page so is completely compatible with page caching.

@jensfilipsson

I know you posted a while ago and I don’t know if you have fixed your problem, but if your still looking for a solution then have a look in /etc/nginx/conf/wpfc.conf…

If you can find away to identify the bits you want to exclude you can list them here…

If for example you want to exclude things that use certain cookies then add them to this section…

# Don't use the cache for logged in users or recent commenter
if ($http_cookie ~* "comment_author|wordpress_[a-f0-9]+|wp-postpass|wordpress_no_cache|wordpress_logged_in") {
  set $skip_cache 1;

If you use hhvm then you might want to have a look in /etc/nginx/conf/wpfc-hhvm.conf

Don’t want to cache a certain url then include it in this section…

# Don't cache URL containing the following segments
if ($request_uri ~* "(/wp-admin/|/xmlrpc.php|wp-.*.php|index.php|/feed/|sitemap(_index)?.xml|[a-z0-9_-]+-sitemap([0-9]+)?.xml)") {
  set $skip_cache 1;

I hope this might point someone in the right direction if they find this and need to do the same sort of thing…

But be aware that this file does warn that…

# DO NOT MODIFY, ALL CHANGES LOST AFTER UPDATE EasyEngine (ee)

So you might want to include the code in a new file and add it to the includes in your virtual hosts block…

If you have a lot of content that is, or needs to be dynamic then consider using microcaching instead…

No partial caching though I am afraid, not with this setup, but microcaching I have seen very well, a little google will reveal what its all about…

Hi @jensfilipsson

It’s been a long time, and we haven’t heard from you. It looks like your issue is resolved.

I am closing this support topic for now. Feel free to create a new support topic if you have any queries further. :slight_smile: