Rajin Sharwar
Forum Replies Created
-
Forum: Plugins
In reply to: [Serve Static - Automatic WordPress Static Page generator] fantastic workKindly update to new version 2.4. I have introduced two filters “serve_static_enable_logged_in” and “serve_static_logged_in_role” to enable cache for logged-in users.
Use “serve_static_enable_logged_in” filter to enable cache save as a logged-in user. By default as an Administrator.
Example:add_filter( 'serve_static_enable_logged_in', function( $value ) {
return true;
} );Use “serve_static_logged_in_role” filter to change the type of user used to generate the cache as logged-in. This filter won’t work if you don’t have the used the “serve_static_enable_logged_in” filter already. By default, it’s value is Administrator.
Example to change the cache generation as a logged-in Subscriber user:add_filter( 'serve_static_logged_in_role', function( $value ) {
return 'Subscriber';
} );Check this link to find the Text’s you can use. Not applicable if you have custom User role: https://www.ads-software.com/documentation/article/roles-and-capabilities/#summary-of-roles
Just a headsup, this will only work when you are manually generating the cache from the Cache Generator.
- This reply was modified 3 weeks, 2 days ago by Rajin Sharwar.
Forum: Plugins
In reply to: [Serve Static - Automatic WordPress Static Page generator] fantastic workHi @muhmentz, thank you so much for your suggestions. I have been a bit busy lately so I couldn’t get back here on this. I am thinking of adding this feature, but not sure about how quick it will be. But I will post here as soon as that happens. If you need this feature urgently, you can send me a message from the plugin’s Support tab, and I will get back to you via email.
Thank you again for your feedback. ??
Forum: Plugins
In reply to: [Redis Object Cache] Weird aggressive caching of Rest API endpointYeah never mind, I found it was due to the srcache full page caching module I was using. Thanks anyway.
Forum: Plugins
In reply to: [Serve Static - Automatic WordPress Static Page generator] fantastic workThank you so much for your suggestion. Yeah I will be surely checking on it, maybe if not a option, I am thinking of introducing a filter, which one can use to include the logged in users in the cache as well.
Sorry I’m late to this but to answer:
- I do not think it’s necessary to use other cache plugins. This plugin already has options to minify and compress so you should be good. Just a heads up, caching from this plugin is completely disabled for logged-in users, so if you would like to cache content for logged-in users, you can try to use another caching plugin with this.
- Yes it can. For example, if you have minified using WP Rocket, this plugin should save the minifed HTML from the WP Rocket. If your source code has JS/CSS files of minified versions, this plugin should as well save the minified versions of those. But there can be come incompatibility, which you can report and I will try to take a look.
Thank you for suggestions as well. Just a heads up, you can clear cache of indiviual pages from the Admin Toolbar. If you view the page as an Administrator, you shall see the option to flush the cache of a particular page.
Forum: Reviews
In reply to: [Serve Static - Automatic WordPress Static Page generator] A developer’s gemThank you @muhmentz! Your words compensated the work, thanks again.
Forum: Plugins
In reply to: [Serve Static - Automatic WordPress Static Page generator] fantastic workHi @muhmentz, unfortunately as of now, the HTML caching will only work for logged-out users. HTML caching is completely disabled for logged-in users, whcih means if you have pages that require users to login, it won’t cache the HTML of those pages.
Initially, I had the plan to make the plugin compatible for logged-in users as well. But later I realized, it’s going to conflict with a lot of plugins and features if I do so. For example, as these pages will be served from an HTML cache, the user won’t see anything dynamic on his end, all will be just simple static assets. That’s the reason, unfortunately, I am unable to make this work for logged-in users. Thanks for your feedback though, I will take a further look later.
Cool!
Hi @tmcguire, just released the fixed version. ?? Kindly update to V2.3 to get this fixed.
Thanks! Yeah, I am able to replicate it. Will update the patch for this within a few hours.
Thanks for sharing! What’s your PHP version @tmcguire?
Hi @tmcguire, sorry to hear that!
Can you please try enabling the error_log from your wp_config.php file, and share with me the error logs? Follow this doc to learn on how to enable the error logging: https://themeisle.com/blog/wordpress-error-log-debug/
Thank you so much for your inspirational words @bismawy. Much appreciated.
“And sometimes it doesn’t work either when clicking “Regenerate cache for this URL”.
So, what that button does is, it sends a request for the cache to be generated. It doesn’t generate the cache on the page load, because i didn’t want it to consume PHP memory, and thought to keep it as a background process. So, after clicking Regenerate cache, you might still see “Cache missing” for a few seconds. But after that, the Status bar will become green eventually indicating that the cache is generated.
I hope this explains. Thanks again for your words!
Hey @tmmtechnology, that’s correct. Maybe you can try to use a fallback method for Windows, or just simply hardcode the slug as “cache-warmer”, as it is very unlikely to change, instead of getting from the plugins folder.
So, after debugging I found that this line in cache-warmer.php is not able to get the plugin slug correctly, which is causing the issue.
self::$slug = $dir_parts[ array_search( 'plugins', $dir_parts, true ) + 1 ];