Page caching discussion

Fixing problems with JSP and caching proxy server
 
Many of the proxy servers in use today are caching servers. These servers tend to recognize cgi, asp, and cfm as dynamic. They then always request a new page from the server rather than giving their client the page from the proxy cache. The problem is that most of these proxies do not recognize jsp as dynamic. To make matters worse, if the proxy server asks for the last modified date from the jsp page, it gets the compile date.
There is a simple fix for this. Add the following to your JSP pages where you have this problem.

%!
return current time to proxy server request
public long getLastModified(HttpServletRequest request) {
 return System.currentTimeMillis();
}
%

To ensure that the web-browser itself will always obtain the latest version of the page, the following can be added to the beginning of your JSP (before any content has been committed).

response.setHeader( Cache-Control, no-cache );
response.setHeader( Pragma, no-cache );
response.setIntHeader( Expires, 0 );
------------------------------------------------------------------------------
Comment:
i have used this tags in my jsp page where i m using post method.
%response.setHeader( Cache-Control, no-cache ); response.setHeader( Pragma, no-cache ); response.setIntHeader(Expires, 0 ); %

Now the problem is whenever i submit my form and then go back & forward it gives me this warning.......so i m not able to view my page.....

Warning Page has Expired The page you requested was created using information you submitted in a form. This page is no longer available. As a security precaution, Internet Explorer does not automatically resubmit your information for you. To resubmit your information and view this Web page, click the Refresh button.
------------------------------------------------------------------------------
You can stop pages caching their data...  It's a pain (as there are buggy browsers out there), but this works for us:

<%
        // Set to expire far in the past.
        response.setHeader("Expires", "Sat, 6 May 1995 12:00:00 GMT");

        // Set standard HTTP/1.1 no-cache headers.
        response.setHeader("Cache-Control", "no-store, no-cache, must-revalidate");

        // Set IE extended HTTP/1.1 no-cache headers (use addHeader).
        response.addHeader("Cache-Control", "post-check=0, pre-check=0");

        // Set standard HTTP/1.0 no-cache header.
        response.setHeader("Pragma", "no-cache");
%>
------------------------------------------------------------------------------
You will need to set the appropriate HTTP header attributes to prevent the dynamic content output by the JSP page from being cached by the browser. Just execute the following scriptlet at the beginning of your JSP pages to prevent them from being cached at the browser.

You need both the statements to take care of some of the older browser versions.
<%
response.setHeader("Cache-Control","no-cache"); //HTTP 1.1
response.setHeader("Pragma","no-cache"); //HTTP 1.0
response.setDateHeader ("Expires", 0); //prevents caching at the proxy server
%>
If the above fails, try changing the first line to
response.setHeader("Cache-Control","no-store"); //HTTP 1.1

The difference between no-cache and no-store is a bit dodgy, but apparently no-cache is the more polite keyword. However, please note that there are some problems with disabling page caching under IE 5.0 due to the unique buffering requirements of the browser. Please see the Microsoft knowledge base for details:

http://support.microsoft.com/support/kb/articles/Q222/0/64.ASP
http://support.microsoft.com/support/kb/articles/Q234/2/47.ASP

i added this code to the page.

<meta http-equiv="expires" content=<%= new java.util.Date() %>>
<meta http-equiv="no-cache">

added within the head tags.it worked for all browsers.
<%
response.setHeader("Cache-Control","no-cache"); //HTTP 1.1
response.setHeader("Pragma","no-cache"); //HTTP 1.0
response.setDateHeader ("Expires", -1);
%>

I am also doing this at the very bottom of the JSP file:

</body>  <!-- end of the content body -->
<HEAD>
<META HTTP-EQUIV="PRAGMA" CONTENT="NO-CACHE">
</HEAD>
</html>

 

<think>好的,用户提到在安装麒麟系统时遇到了“no caching mode page found”的问题。我需要先理解这个错误信息的含义以及可能的原因。麒麟系统通常是基于Linux的,所以这可能是一个与Linux安装相关的问题。 首先,“no caching mode page found”可能与存储设备有关,尤其是在硬盘或SSD的缓存设置上。缓存模式页是SCSI命令的一部分,用于控制设备的缓存功能。当系统检测不到缓存模式页时,可能会出现这样的警告或错误。 接下来,我需要考虑可能的解决方案。常见的处理方法包括检查存储设备的兼容性,确认是否支持当前的缓存模式,或者尝试在安装时添加内核参数来禁用缓存相关的设置。例如,在Linux安装过程中,通过添加“libata.force=noncq”或“nomodeset”等参数来绕过缓存问题。 另外,用户可能在安装过程中使用了一些特定的硬件配置,比如较旧的硬盘或某些RAID设置,这些可能导致驱动不兼容。建议用户检查硬件兼容性列表,或尝试更换存储设备进行安装测试。 还需要考虑安装介质的问题,比如U盘或光盘是否有损坏,导致安装程序无法正确读取缓存信息。建议用户验证安装介质的完整性,或重新制作启动盘。 最后,用户可能需要查看系统日志,如dmesg或/var/log/syslog,以获取更详细的错误信息,帮助进一步诊断问题。如果所有方法都无效,可能需要联系麒麟系统的技术支持,提供详细的硬件配置和错误日志,寻求专业帮助。 总结起来,解决这个问题的步骤可能包括:检查硬件兼容性、尝试内核参数调整、验证安装介质、查看系统日志,以及联系技术支持。需要一步步引导用户排除可能的原因,找到具体的解决方法。</think>在安装麒麟系统时遇到`no caching mode page found`错误,通常与存储设备(如硬盘、SSD或U盘)的缓存模式或驱动兼容性有关。以下是逐步分析和解决方法: --- ### **1. 错误原因分析** - **缓存模式页缺失**:该提示表明系统未检测到存储设备的缓存模式页(Caching Mode Page),这是SCSI/SATA协议中用于管理设备缓存的参数。 - **可能触发场景**: - 使用老旧或非标准存储设备。 - 驱动未正确识别设备缓存功能。 - 安装介质(如U盘)的兼容性问题。 --- ### **2. 临时解决方法** #### **(1) 尝试禁用设备缓存** 在安装引导界面添加内核参数,强制禁用缓存或队列功能: 1. 启动安装程序时,在引导菜单按 `e` 键(或提示的编辑键)进入编辑模式。 2. 在 `linux` 或 `linuxefi` 行末尾添加以下参数之一: ```bash libata.force=noncq # 禁用命令队列(适用于SATA设备) nomodeset # 禁用显卡模式设置(可能间接缓解存储问题) ata_piix.pata_legacy=1 # 强制启用传统IDE模式 ``` 3. 按 `Ctrl+X` 或 `F10` 启动系统,观察是否解决错误。 #### **(2) 更换安装介质** - 重新制作启动U盘,使用官方工具(如`dd`命令或Ventoy)并确保ISO文件完整。 - 尝试更换U盘或使用其他接口(如USB 2.0端口)。 --- ### **3. 长期解决方案** #### **(1) 更新固件或驱动** - **更新存储设备固件**:访问硬盘/SSD厂商官网,下载并安装最新固件。 - **更新系统内核**:安装完成后,通过终端更新内核: ```bash sudo apt update && sudo apt upgrade ``` #### **(2) 检查硬件兼容性** - 确认存储设备在麒麟系统的[硬件兼容列表](https://www.kylinos.cn/support/)中。 - 若使用RAID或特殊控制器,尝试改为AHCI模式(需在BIOS中调整)。 --- ### **4. 进一步诊断** #### **(1) 查看系统日志** 安装完成后(或进入Live模式),通过以下命令排查详细错误: ```bash dmesg | grep -i "cache" # 过滤缓存相关日志 journalctl -p 3 -xb # 查看系统启动错误 ``` #### **(2) 手动加载驱动** 若设备需特定驱动(如`ahci`、`sd_mod`),手动加载: ```bash sudo modprobe ahci # 加载AHCI驱动 sudo modprobe sd_mod # 加载SCSI磁盘驱动 ``` --- ### **5. 联系技术支持** 若问题仍未解决,建议: 1. 提供硬件型号、麒麟系统版本、错误日志。 2. 访问[麒麟社区论坛](https://www.kylinos.cn/)或联系官方支持。 --- 通过以上步骤,可系统性排查和解决`no caching mode page found`问题。如果涉及企业级环境,建议在操作前备份数据并谨慎调整硬件设置。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值