• Resolved georg

    (@fertila)


    I would like to exclude the external RSS Feed news.fertila.de from caching on my home under fertila.de. How can i do this in htaccess or WP LS Plugin? Thanks.

    The page I need help with: [log in to see the link]

Viewing 9 replies - 1 through 9 (of 9 total)
  • Hi @fertila ,

    You can utilize the Exclude Cache option, Here’s a detailed Wiki – https://www.litespeedtech.com/support/wiki/doku.php/litespeed_wiki:cache:lscwp:configuration:excludes#do_not_cache_uris

    Best Regards

    Thread Starter georg

    (@fertila)

    Hi Shivam,
    thanks a lot for the reply and the hint.
    I had a look in the documentation already and tried to exclude ^news.fertila.de/feed/
    However this does not work. The only way I could see is to exclude my home, which I do not want.
    Any other ideas?
    Best regards
    Georg

    Hi @fertila, the setting page Do Not Cache URIs are just working for the same root domain. If you’d like to exclude another domain from cache, you may try the following script, please try to put the following method on theme’s function.php:

    if ( method_exists( 'LiteSpeed_Cache_API', 'set_nocache' ) ) {
    	$actual_link = "http://$_SERVER[HTTP_HOST]$_SERVER[REQUEST_URI]";
    
    	if ( $actual_link === 'http://YOUR_ROOT_URL/' ) {
    		LiteSpeed_Cache_API::set_nocache( 'Disable root URL from cache' ) ;
    	}
    }
    Thread Starter georg

    (@fertila)

    Hi @stanleylitespeed
    thank you so much for the code snippet.
    I put

    if ( method_exists( 'LiteSpeed_Cache_API', 'set_nocache' ) ) {
    	$actual_link = "https://$_SERVER[HTTP_HOST]$_SERVER[REQUEST_URI]";
    
    	if ( $actual_link === 'https://news.fertila.de/' ) {
    		LiteSpeed_Cache_API::set_nocache( 'Disable root URL from cache' ) ;
    	}
    }

    in my functions.php. However this does not seem to work. Anything else I might have to consider?

    Georg

    • This reply was modified 6 years, 5 months ago by georg.
    • This reply was modified 6 years, 5 months ago by georg.

    Did you purge the cache and rerun again? Also, can you check does LiteSpeed_Cache_API::set_nocache run inside the condition?

    Thread Starter georg

    (@fertila)

    I just purged the cache. How would I check if LiteSpeed_Cache_API::set_nocache runs inside the condition?

    You can put an error_log inside that condition to print out something on log or check on the LiteSpeed debug log.

    Thread Starter georg

    (@fertila)

    I cannot see nocache instances for this URL in the debug log.

    Could you try to simply put LiteSpeed_Cache_API::set_nocache( 'Disable root URL from cache' ) ; on functions.php, purge all cache and see does that page loaded without cache hit.

    If it’s still not working please join our Slack channel and find me(Stanley Cheung at Litespeed) for reproducing the issue.

Viewing 9 replies - 1 through 9 (of 9 total)

The topic ‘Exclude RSS’ is closed to new replies.