Issue was with the SDI, that we use for XF caching, when SDI was enable it was adding one CSS file in the page source for XF component so this CSS file was altering the page's look and fill but when I was using query parameter, it was skipping the SDI as well as dispatcher so getting the actual content as it was there on the publisher server.
* Do you have any CDN on top of your AEM tier? If yes, try to reproduce the issue by bypassing the CDN.
* If you aren't using any CDN:
a) Are you clearing the cache manually, or are you using the dispatcher flush agent to flush the cache when content is published? If you are using dispatcher flush agent, verify whether the dispatcher flush queue isn't stuck.
If clearing the cache manually, enable DEBUG logging on dispatcher, restart the apache server, clear all cache, and then try to reproduce the issue. Do a tail of the dispatcher log file, and then try to access that page, and see how the request is being served, in the dispatcher log file.
b) If you have an XF that you clear the cache for, but use the same XF on multiple pages, if you publish the XF, the flush will clear the cache of that XF only. It won't clear that XF cached on the pages on which it's being used. They need to be flushed/cleared separately. For that you can write a custom script, that gets triggered when you the XF is published, such that it clears the cache of the pages on which the XF is being used. This way, it will serve the fresh content.