如何防止需要POST数据的特定页面的浏览器缓存?

I am new to browser caching. I have following codes in my .htaccess file:

## EXPIRES CACHING ##
<IfModule mod_expires.c>
ExpiresActive On
ExpiresByType image/jpg "access 1 year"
ExpiresByType image/jpeg "access 1 year"
ExpiresByType image/gif "access 1 year"
ExpiresByType image/png "access 1 year"
ExpiresByType text/css "access 1 month"
ExpiresByType text/html "access 1 month"
ExpiresByType application/pdf "access 1 month"
ExpiresByType text/x-javascript "access 1 month"
ExpiresByType application/x-shockwave-flash "access 1 month"
ExpiresByType image/x-icon "access 1 year"
ExpiresDefault "access 1 month"
</IfModule>
## EXPIRES CACHING ##

I have few web pages that require POST data to be displayed. I don't want text/html response to be cached for these pages. It is ok if it caches images, css and javascript. How can I achieve that through .htaccess?

doumeng3188
doumeng3188 尝试使用这个www.xyz.com/nocache.php?no_cache=1,如果一个url有一个query_string(例如?no_cache=1),那么它不会被浏览器缓存,而是再次请求
4 年多之前 回复
duanao2688
duanao2688 如何通过.htaccess专门为单个页面绕过缓存text/html响应?如果该页面是www.xyz.com/nocache.php,你能帮我一个代码吗?
4 年多之前 回复
drjyvoi734793
drjyvoi734793 你可以添加一个简单的url参数,例如?has_post=1(每次你发布数据)并让apache不缓存页面,如果它有一个query_string(如果我没有弄错的话已经发生),否则你将不得不绕过缓存对于整个页面是否有post_data(例如,通过在.htaccess中为此pag显式添加一个条目)
4 年多之前 回复
Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!
立即提问