Wordpress LScache Plugin: Missing $_SERVER information
Last Updated on: Wed, 15 Apr 2026 00:00:02 We use PHP to get the referring page ( $_SERVER[HTTP_REFERRER] ) to help track form conversions. While this method works great on other websites that weve built (and host on the same server), we are having a problem with one of our sites where this information is not being tracked properly. I created a custom plugin and added this code to record data to the error_log: add_action(init, GF_User_Tracking::test_error_log) class GF_User_Tracking function test_error_log() error_log( print_r( $_SERVER, true)) After clearing the cache, the proper data is stored. However, once the cache has been created for a page, visiting that page is not recorded in the error_log. The same thing happens when I disable cache entirely. I suspect its due to a setting or perhaps a conflicting plugin but I wanted to reach out first before diving into the issue. This topic was modified 1 year, 11 months ago by ccgjosh. Hi, The same thing happens when I disable cache entirely. wait a second , the issue still happens with cache plugin disabled ? which server envs you can see if you create a phpinfo page ? Best regards, Sorry, I should have been more clear ? when the cache is disabled, the error_log shows the correct data. PHP info can be viewed here. Hi, okay , then that makes sense when page is cached, PHP will NOT be running at all , so it wont log it out you may need to invoke ESI for this if you use ESI , you can use $_SERVER[ESI_REFERER] to get the refer link from parent URI Best regards, It looks like simply enabling ESI has solved the issue. I will keep an eye on it and do more research if needed. Thanks for your help!
LiteCache Rush: Speed comes from using less, not from doing it faster
Reference