We are having an issue where different user accounts are getting different stats when downloading csv from the front end.
The code on bp-course-ajax.php and statistics.php generates a file using the following logic
$file_name = 'download_'.$course_id.'_'.$user_id.'.csv';
This title should be more unique to bypass server side caching. Perhaps by including a timestamp. Eg.
$time_code = new Datetime("now");
$time_code = $time_code->format('U');
$file_name = 'download_'.$course_id.''.$user_id.''.$time_code.'.csv';
well we forcefully delete the file before generating new file with the same name .
Please refer :
http://prntscr.com/qxdsjn
I think the problem is that file was being cached by our server WPEngine. Even if deleted it's still in the cache. I get that we don't want to fill up the server but a unique name would definitely bypass this. Perhaps a unique combined with a a wildcard reference to the old file to be deleted since it still has the unit/user ids?
restrict the url from being cached.