I have a work-around for now: I save the retrieved page myself in the folder that holds the cashed data. That works! Only the statistics of the build of the page are disappeared. Not a big deal, but maybe there is a better solution
Unfortunately this is not working correctly: minify css and compression are not done!
I tried the option: ?action=wpfastestcache&type=preload but that does not work for the specific page.
We are working on a beta feature as below. do you want this feature?
https://www.wpfastestcache.com/features/automatic-cache/
This is definitely an improvement, but I have to do it manually. I have to respond to changes in the records in a table! I have a job that does the work. In simplified code this is what it is:
if (changedInDatabase(1234)) {
delete(path . “…./all/mypage/1234/”);
data=request(“www.mysite.com/mypage/1234/”); // alter this …
deregisterInDatabase(1234);
}
For me it would be a solution if the third line would respond to something like:
data=request(“www.mysite.com/mypage/1234/?action=wpfastestcache&type=recache“);
Do you think this is possible? Now I do get the page, but no caching is done!
-
This reply was modified 6 years, 4 months ago by
hsteigstra.
this is not possible 🙂
Not possible or a challenge to implement??
Or… why do I get the cached and minified page when requested via the browser, but not when requested from the background process. After requesting the page from the browser, I do get the cached page in the background process…..
-
This reply was modified 6 years, 4 months ago by
hsteigstra.
if you write a code manually, you can do by yourself. you do not need a function of wp fastest cache.
with PHP;
file_get_contents("http://www.mysite.com/mypage/1234")
This is what I already do…. Unfortunately I get the unzipped, not minified version. The cache is NOT rebuilt! It looks as if the WPFC thinks the request comes from a logged in user, but it is done by the server running in the background, not me!
you should use the following code because you need to exclude the admin cookie. Do you know how to use wp native functions?
$url = "http://www.mysite.com/mypage/1234";
$response = wp_remote_get($url, array('user-agent' => $user_agent, 'timeout' => 10, 'sslverify' => false, 'headers' => array("cache-control" => "no-store, no-cache, must-revalidate, post-check=0, pre-check=0")));
Almost there! I don’t have experience with the wp native functions, but yet implemented the code. Only after removal of the parameter array I got it working!! I just cannot get the body data itself, what I only need to check the success.
Anyway, the data is rebuilt correctly now, and hopefully I will find my way to retrieve the length of the response. This is now the code:
$response = wp_remote_get($uri);
if ( is_wp_error( $response ) ) {
report error;
} else {
$body = wp_remote_retrieve_body( $response );
$data = json_decode( $body );
$len=strlen($data->Data); // >> is zero
}
Thank you for your assistance !!
I also got the content now. This is the complete code to retrieve the data:
$response = wp_remote_get($uri);
if ( is_wp_error( $response ) ) {
report error: (“Failed to retrieve $uri”);
$len=0; // failure!
} else {
$body=$response[‘body’];
$len=strlen($body); // success !
}
Thank you for your assistance !!
-
This reply was modified 6 years, 4 months ago by
hsteigstra. Reason: success now!