Do you get no change or any difference on mobile devices? Does the same lightbox appear on both desktops and mobile devices, despite having set them differently? Most likely the desktop version got cached and it's getting served to mobile devices as well. A separate cache can be set up just for mobile devices. This fix is for W3 Total Cache:
- Go to W3 Total Cache settings (Performance) > User Agent Groups page.
- Tick Enabled for the predefined groups there.
- Click the Save all settings button.
It keeps all benefits of caching using different cache. It’s not an exclusion of mobile devices from caching! If you are interested in rejecting some mobile devices for caching, see W3 Total Cache settings > Page Cache > Advanced > Reject User Agents setting.