Caching plugins

TL;DR Don't use caching for the download urls, and whitelist /gf-entries-in-excel/* in your caching plugin.

Why?

When your site uses as caching plugin like WP Rocket, WP Super Cache, W3 Total Cache or any other caching plugin, you can expect some strange behavior from the download link like:

  • The downloaded file always contains the same content
  • The download link only works once
  • The download doesn't work at all

The download link is always returning the current results from the database. Therefore caching these URLs isn't helpful.

Allow-list all download links

Although the plugin returns headers that say the response should not be cached, most caching plugins will think they know better. But almost every caching plugin has a whitelist. So if you have issues with downloading the file, and you have a caching plugin; find out how it can whitelist URLs, and add /gf-entries-in-excel/*, /gravityexport-lite/*, and /gravityexport/* to it (assuming it takes an asterisk (*) as a wildcard).