You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@struts.apache.org by "JCgH4164838Gh792C124B5 (via GitHub)" <gi...@apache.org> on 2023/01/22 21:09:08 UTC

[GitHub] [struts-site] JCgH4164838Gh792C124B5 opened a new pull request, #183: Adds initial documentation on OGNL cache configuration

JCgH4164838Gh792C124B5 opened a new pull request, #183:
URL: https://github.com/apache/struts-site/pull/183

   Hello Struts Development Team.
   
   This is an initial attempt to add some documentation on OGNL cache configuration.  Not sure if the templating structure is OK or not.  Please advise if it can be modified and of use for the documentation site.
   
   Regards.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@struts.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@struts.apache.org
For additional commands, e-mail: dev-help@struts.apache.org


[GitHub] [struts-site] lukaszlenart commented on a diff in pull request #183: Adds initial documentation on OGNL cache configuration

Posted by "lukaszlenart (via GitHub)" <gi...@apache.org>.
lukaszlenart commented on code in PR #183:
URL: https://github.com/apache/struts-site/pull/183#discussion_r1083710358


##########
source/core-developers/ognl-cache-configuration.md:
##########
@@ -0,0 +1,90 @@
+---
+layout: core-developers
+title: OGNL Cache Configuration
+---
+
+# OGNL Cache Configuration
+
+The Struts framework provides two different OGNL caches, an expression cache and a BeanInfo cache.
+Developers may set properties in [struts.xml](struts-xml) and/or [default.properties](default-properties) to 
+configure certain behaviours for the OGNL caches.  The properties that can be set vary between Struts 
+versions, referring to the configuration files in a given version should provide guidance in that respect.
+
+The OGNL expression cache is enabled by default.  Developers can toggle that state via default.properties:
+```
+struts.ognl.enableExpressionCache=true
+```
+or
+```
+struts.ognl.enableExpressionCache=false
+```
+The same toggle is also available via struts.xml:
+```
+<constant name="struts.ognl.enableExpressionCache" value="true"/>
+```
+or
+```
+<constant name="struts.ognl.enableExpressionCache" value="false"/>
+```
+
+Disabling the OGNL expression cache can have a negative impact on performance, but 
+disabling the cache can limit memory overhead for the application (a trade-off).
+
+As of Struts 2.6, additional configuration properties have been made available to control the

Review Comment:
   Could you use "6.0.0" term?



##########
source/core-developers/ognl-cache-configuration.md:
##########
@@ -0,0 +1,90 @@
+---
+layout: core-developers
+title: OGNL Cache Configuration
+---
+
+# OGNL Cache Configuration
+
+The Struts framework provides two different OGNL caches, an expression cache and a BeanInfo cache.
+Developers may set properties in [struts.xml](struts-xml) and/or [default.properties](default-properties) to 
+configure certain behaviours for the OGNL caches.  The properties that can be set vary between Struts 
+versions, referring to the configuration files in a given version should provide guidance in that respect.
+
+The OGNL expression cache is enabled by default.  Developers can toggle that state via default.properties:
+```
+struts.ognl.enableExpressionCache=true
+```
+or
+```
+struts.ognl.enableExpressionCache=false
+```
+The same toggle is also available via struts.xml:
+```
+<constant name="struts.ognl.enableExpressionCache" value="true"/>
+```
+or
+```
+<constant name="struts.ognl.enableExpressionCache" value="false"/>
+```
+
+Disabling the OGNL expression cache can have a negative impact on performance, but 
+disabling the cache can limit memory overhead for the application (a trade-off).
+
+As of Struts 2.6, additional configuration properties have been made available to control the
+OGNL cache configuration.  These include a configureable cache size limit, and activating
+an LRU (Least Recently Used) cache mode.  The expression cache and BeanInfo cache can have
+their properties set independently.  Both caches are standard caches with a high maximum
+capacity by default.  The developer may override the default behaviour using the 
+appropriate configuration properties.
+
+Below are some examples of setting the cache configuration via default.properties:
+```
+### Set expression and BeanInfo caches to size 1250 with standard cache mode
+struts.ognl.enableExpressionCache=true
+struts.ognl.expressionCacheMaxSize=1250
+struts.ognl.expressionCacheLRUMode=false
+struts.ognl.beanInfoCacheMaxSize=1250
+struts.ognl.beanInfoCacheLRUMode=false
+```
+```
+### Set expression and BeanInfo caches to size 1000 with LRU cache mode
+struts.ognl.enableExpressionCache=true
+struts.ognl.expressionCacheMaxSize=1000
+struts.ognl.expressionCacheLRUMode=true
+struts.ognl.beanInfoCacheMaxSize=1000
+struts.ognl.beanInfoCacheLRUMode=true
+```
+
+Below are some examples of setting the cache configuration via struts.xml:
+```
+<!-- Set expression and BeanInfo caches to size 1250 with standard cache mode -->
+<constant name="struts.ognl.enableExpressionCache" value="true"/>
+<constant name="struts.ognl.expressionCacheMaxSize" value="1250"/>
+<constant name="struts.ognl.expressionCacheLRUMode" value="false"/>
+<constant name="struts.ognl.beanInfoCacheMaxSize" value="1250"/>
+<constant name="struts.ognl.beanInfoCacheLRUMode" value="false"/>
+```
+```
+<!-- Set expression and BeanInfo caches to size 1000 with LRU cache mode -->
+<constant name="struts.ognl.enableExpressionCache" value="true"/>
+<constant name="struts.ognl.expressionCacheMaxSize" value="1000"/>
+<constant name="struts.ognl.expressionCacheLRUMode" value="true"/>
+<constant name="struts.ognl.beanInfoCacheMaxSize" value="1000"/>
+<constant name="struts.ognl.beanInfoCacheLRUMode" value="true"/>
+```
+
+As of Struts 2.6, developers may choose to implement their own OGNL cache factories,

Review Comment:
   Same here, please use "6.0.0" to avoid confusing users



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@struts.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [struts-site] lukaszlenart merged pull request #183: Adds initial documentation on OGNL cache configuration

Posted by "lukaszlenart (via GitHub)" <gi...@apache.org>.
lukaszlenart merged PR #183:
URL: https://github.com/apache/struts-site/pull/183


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@struts.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@struts.apache.org
For additional commands, e-mail: dev-help@struts.apache.org


[GitHub] [struts-site] JCgH4164838Gh792C124B5 commented on pull request #183: Adds initial documentation on OGNL cache configuration

Posted by "JCgH4164838Gh792C124B5 (via GitHub)" <gi...@apache.org>.
JCgH4164838Gh792C124B5 commented on PR #183:
URL: https://github.com/apache/struts-site/pull/183#issuecomment-1418255109

   Hi.  The two requested changes have been made.  Please let me know if any other changes are needed.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@struts.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [struts-site] lukaszlenart commented on pull request #183: Adds initial documentation on OGNL cache configuration

Posted by "lukaszlenart (via GitHub)" <gi...@apache.org>.
lukaszlenart commented on PR #183:
URL: https://github.com/apache/struts-site/pull/183#issuecomment-1418743668

   Thanks, LGTM 👍 


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@struts.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org