Hey @flamuren ,
Thanks for the feedback, We’re glad you’re finding WP-Optimize useful!
To answer your question—while WP-Optimize allows you to exclude specific pages from caching, excluding a specific widget or .div
directly isn’t something that can be done from within the plugin itself. But don’t worry, there’s a way around this!
Here’s what you can try:
- Fragment Caching with Shortcodes: If your theme or plugin provides a shortcode for your “Latest Jobs” widget, you can use WP-Optimize’s “Do Not Cache” option for pages or content with specific shortcodes. This won’t directly exclude the
.div
, but it will prevent caching for the part of your page where the shortcode is placed.
- Use AJAX for the Widget: If your widget supports AJAX, this is the best way to keep it dynamic while the rest of the page remains cached. Unfortunately, WP-Optimize doesn’t have a built-in option to exclude specific HTML elements like a
.div
, but AJAX ensures the content is fetched fresh each time while maintaining the cache for the rest of the page.
- Lower Cache Expiry Time: If excluding the widget isn’t possible for now, you could reduce the cache expiry time for the homepage so that your latest jobs update more frequently without you manually purging the cache every time. You can adjust this in the WP-Optimize caching settings.
Hope it helps, let me know how it goes : )
Best regards,