Add an Expires or a Cache-Control Header in JSP - Stack Overflow
To disable browser cache JSP pages, create a Filter
which is mapped on an url-pattern
of*.jsp
and does basically the following in the doFilter()
method:
HttpServletResponse httpResponse = (HttpServletResponse) response; httpResponse.setHeader("Cache-Control", "no-cache, no-store, must-revalidate"); // HTTP 1.1 httpResponse.setHeader("Pragma", "no-cache"); // HTTP 1.0 httpResponse.setDateHeader("Expires", 0); // Proxies.
This way you don't need to copypaste this over all JSP pages and clutter them with scriptlets.
To enable browser cache for static components like CSS and JS, put them all in a common folder like/static
and create a Filter
which is mapped on an url-pattern
of /static/*
and does basically the following in the doFilter()
method:
httpResponse.setDateHeader("Expires", System.currentTimeMillis() + 604800000L); // 1 week in future.
WebLogic的多池Multi-Pool - 无法无天耗的日志 - 网易博客
客户的做法是这样的:
后台是Oracle的RAC数据库,他配置了一个多池,有2个Pool,PoolA主要连RAC的A实例,PoolB主要连RAC的B实例.其实他的PoolA和PoolB都是用了RAC格式的JDBC的写法,后面是一个主机列表,PoolA将A实例的IP写在了前面,PoolB将B实例的IP写在了前面,JDBC的算法是failover=yes load_banlance=no,这样每一个Pool将请求都发送到自己的第一个host的Oracle的实例上,在第一个host的Oracle实例出现故障时候切换到另外一个host的Oracle实例上.
PoolA和PoolB的JDBC的写法如下,注意failover=yes和load_banlance=yes,这样写的作用是当请求来的时候都转发给第一个host,只有出现第一个host有问题,才会将请求发送到第二个host:
WLS JDBC URL 的配置如下:
配置的多池的算法如果是High Availability的话,那么压力将始终压到一个Pool上面,另外一个Pool处于stand-by的状态,除非处理请求的Pool出现故障.客户的监控情况也是如此,发现压力都压在了一个Oracle的实例上.
如果多池的算法是Load Banlance的话,那么压力将平均分配到2个Pool上面.如果想使用多池的high availability的算法,则不要设置test的重试次数,如果设置了,则会出错抛出异常.
为了能使被标记为disable的PoolA能够恢复正常的连接,则需要设置HealthCheckFrequencySeconds的值在config.xml里面,该值在console上面没有.
另外还要能够使用TestConnectionsOnReserve.