|
IOTN :: Field Book :: ORACLE 
 |
weblogic cache
|
ÃÖ±æÈ£
[LIST]
|
2018-02-28 10:26:19, Á¶È¸ : 236,825 |

ÀÌ Cache Filter¸¦ »ç¿ëÇϸé JSP, ServletÀº ¹°·Ð Á¤ÀûÀÎ ÄÁÅÙÆ®µµ ij½ÌÇÒ ¼ö ÀÖ´Ù. ¿¹¸¦ µé¾î À¥·ÎÁ÷
À» À¥¼¹ö·Î Ȱ¿ëÇÒ °æ¿ì HTMLÀ̳ª GIF, JPEG µîÀÇ Á¤ÀûÀÎ ÄÁÅÙÆ®¸¦ ¸Þ¸ð¸®¿¡ ¿Ã·Á ³õ°í »ç¿ëÇϸé Å« ¼º´É
Çâ»ó È¿°ú¸¦ ¾òÀ» ¼ö ÀÖ´Ù. (web.xml)
Response Caching
The cache filter works similarly to the cache tag with the following exceptions:
It caches on a page level (or included page) instead of a JSP fragment level.
Instead of declaring the caching parameters inside the document you can declare the parameters in the configuration of the web application.
The cache filter has some default behavior that the cache tag does not for pages that were not included from another page. The cache filter automatically caches the response headers Content-Type and Last-Modified. When it receives a request that results in a cached page it compares the If-Modified-Since request header to the Last-Modified response header to determine whether it needs to actually serve the content or if it can send an 302 SC_NOT_MODIFED status with an empty content instead.
The following example shows how to register a cache filter to cache all the HTML pages in a web app:
<filter>
<filter-name>HTML</filter-name>
<filter-class>weblogic.cache.filter.CacheFilter</filter-class>
</filter>
<filter-mapping>
<filter-name>HTML</filter-name>
<url-pattern>*.html</url-pattern>
</filter-mapping>
The cache system uses soft references for storing the cache. So the garbage collector might or might not reclaim the cache depending on how recently the cache was created or accessed. It will clear the soft references in order to avoid throwing an OutOfMemoryError.
Initialization Parameters
If you wanted to make sure that if the web pages were updated at some point you got the new copies into the cache, you could add a timeout to the filter. Using the init-params you can set many of the same parameters that you can set for the cache tag:
The initialization parameters are
Name This is the name of the cache. It defaults to the request URI for compatibility with *.extension URL patterns.
Timeout This is the amount of time since the last cache update that the filter waits until trying to update the content in the cache again. The default unit is seconds but you can also specify it in units of ms (milliseconds), s (seconds), m (minutes), h (hours), or d (days).
Scope The scope of the cache can be any one of request, session, application, or cluster. Request scope is sometimes useful for looping constructs in the page and not much else. The scope defaults to application. To use cluster scope you must set up the ClusterListener.
Key This specifies that the cache is further specified not only by the name but also by values of various entries in scopes. These are specified just like the keys in the CacheTag although you do not have page scope available.
Vars These are the variables calculated by the page that you want to cache. Typically this is used with servlets that pull information out of the database based on input parameters.
Size This limits the number of different unique key values cached. It defaults to infinity.
The following example shows where the init-parameter is located in the filter code.
<filter>
<filter-name>HTML</filter-name>
<filter-class>weblogic.cache.filter.CacheFilter</filter-class>
<init-param>
Max-cache-size This limits the size of an element added to the cache. It defaults to 64k.
Ãâó
http://m.cafe.daum.net/sepro/5CO5/64?listURI=%2Fsepro%2F_rec%3Fpage%3D6
1. °³¿ä
jsp ÆÄÀÏÀ» º¯°æÇϰí was¸¦ Àç±âµ¿ Çߴµ¥µµ ¹Ý¿µÀÌ ¾ÈµÇ´Â °æ¿ì°¡ ÀÖ½À´Ï´Ù.
±×·²¶§ ¿£Áø µð·ºÅ丮¿¡ ÀÖ´Â ÄÄÆÄÀÏµÈ ÅÛÇÁ µð·ºÅ丮¸¦ »èÁ¦ÇÑ ÈÄ Àç±âµ¿À» Çϸé Á¦´ë·Î ¹Ý¿µÀÌ µÇ´Âµ¥¿ä.
¸Å¹ø ÀÌ·¸°Ô ÇÏ¸é ³Ê¹«³ªµµ ±ÍÂú±â ¶§¹®¿¡ jsp ÆÄÀÏÀÌ º¯°æ µÈ °æ¿ì ÀÚµ¿À¸·Î ÄÄÆÄÀÏ ÇØÁÖ´Â ¿É¼ÇÀ» ¾Ë·Áµå¸®°Ú½À´Ï´Ù.
À§ ó·³ ´Ù¾çÇÑ ¿É¼ÇµéÀÌ Àִµ¥¿ä. ±× Áß¿¡¼ page-check-seconds ¸¦ »ç¿ëÇØÁÖ½Ã¸é µË´Ï´Ù.
°ªÀº -1, 0, 1 ·Î ÁöÁ¤ÇÒ ¼ö Àִµ¥
-1 Àº üũÇÏÁö ¾Ê°Ú´Ù
0 Àº Ç×»ó üũÇϰڴÙ
1 Àº 1Ãʸ¶´Ù üũÇϰڴÙ
¶ó´Â ¼³Á¤ÀÔ´Ï´Ù. ÇÊ¿äÇØµû¶ó ¼³Á¤ÇÏ½Ã¸é µË´Ï´Ù.
3. ¼³Á¤¹æ¹ý
<jsp-descriptor>
<page-check-seconds>-1</page-check-seconds>
</jsp-descriptor>
Ãâó:
http://sarc.io/index.php/was/1125-weblogic-jsp
clear weblogic cache
1. Shut down Server.
2. Delete the contents of the folder
ORACLE_HOME/user_projects/domains/your_domain/servers/your_server/tmp
You can also delete ORACLE_HOME/user_projects/domains/your_domain/servers/your_server/cache (optional)
3. Restart Server.
Ãâó: http://naive-amseth.blogspot.kr/2010/11/how-to-clear-weblogic-cache.html
<filter>
<filter-name>CacheFilter1</filter-name>
<filter-class>weblogic.cache.filter.CacheFilter</filter-class>
<init-param>
<param-name>timeout</param-name>
<param-value>60</param-value>
</init-param>
</filter>
...
<filter-mapping>
<filter-name>CacheFilter1</filter-name>
<url-pattern>CacheFilterTest1.jsp</url-pattern>
</filter-mapping>
<init-param>
<param-name>timeout</param-name>
<param-value>60</param-value>
</init-param>
<?xml version='1.0' encoding='UTF-8'?>
<web-app>
<display-name>TestApplication</display-name>
<welcome-file-list>
<welcome-file>CacheFilterTest1.jsp</welcome-file>
</welcome-file-list>
<filter>
<filter-name>CacheFilter1</filter-name>
<filter-class>weblogic.cache.filter.CacheFilter</filter-class>
<init-param>
<param-name>timeout</param-name>
<param-value>60</param-value>
</init-param>
</filter>
<filter-mapping>
<filter-name>CacheFilter1</filter-name>
<url-pattern>CacheFilterTest1.jsp</url-pattern>
</filter-mapping>
</web-app>
For further reading you can refer the below link.
http://download.oracle.com/docs/cd/E13222_01/wls/docs92/javadocs/weblogic/cache/filter/CacheFilter.html
There is an alterative solution for this caching by using the wl:cache element. However the CacheFilter may also be used with servlets and static content,unlike the related wl:cache custom tag, which works only in JSP pages.
http://download.oracle.com/docs/cd/E13222_01/wls/docs103/webapp/customtags.html#wp56944
http://weblogic-wonders.com/weblogic/2011/05/04/configuring-cachefilter-in-weblogic/ | 3.235.60.197
|
|
 |
Copyright 1999-2023 Zeroboard / skin by ÃÖ±æÈ£(gilho.kr@gmail.com)
|
|
|