The Media Access Proxy (MAP) supports the caching of both source and rendered images using a proxy server such as the caching proxy in WebSphere® Application Server Edge Components.
The MAP supports two parameters related to caching: proxyHost and proxyPort. These parameters can be set when you install MAP. They can also be changed at any time by editing either the was_profile_root/installedApps/node_name/map.ear/map.war/WEB-INF/ics-config.xml file or the wp_profile_root/installedApps/node_name/map.ear/map.war/WEB-INF/ics-config.xml file, and then restarting the application server on which MAP is running. If these parameters are set, the MAP server will use the proxy server as a forward proxy.
When MAP requests an image from a remote web server, it will route the request through the forward proxy server. The source image will be cached by the forward proxy server and subsequent requests for the same image from MAP will be retrieved from the cache rather than the external web server.
If you use WebSphere Application Server Edge Components as your proxy server, it does not need any special configuration to support this usage, other than having caching enabled. To verify that caching is enabled, open the Caching Proxy administration window. Find the Cache Configuration folder under that the Cache Settings folder. Make sure that the Enable proxy caching box is checked.
The second use of a proxy server with MAP is as a reverse proxy. The proxy server can be configured as a reverse proxy that will pass requests to MAP only if the identical request has not already been cached.
Without the proxy server, an incoming request to MAP is in the following format:
http://fully qualified hostname of Media Access Proxy server:port/map/map_mode/img_dir/rule/image params
whereThe complete URL, including the rule and parameters, must be used when determining if a transcoded image has already been cached or not. The parameters and rule are what distinguishes an image transcoded for one device from the same image transcoded for a different device. When WebSphere Application Server Edge Components are used as the reverse proxy server, there is a parameter that needs to be set on the Caching Proxy that tells it to include the parameters in the request when determining if the results should be cached. This parameter is called CacheQueries, and its setting is explained later in this topic.
For the examples listed later in this topic, the URL to the proxy server is http://proxyserver.ibm.com and URL to MAP is http://mapserver.ibm.com:9080/map/map (or http://mapserver.ibm.com:9080/map/ics).
When using a reverse proxy server, the proxy server name and port number should be used instead of the MAP server and port wherever the MAP server is referenced. For example, the mwp.icsServer parameter in the wp_profile_root/PortalServer/wp.mobile/wp.mobile.mwp/shared/app/config/mwp.properties file should contain
mwp.icsServer = http://proxyserver.ibm.com:80/map/map
instead of
mwp.icsServer = http://mapserver.ibm.com:9080/map/map
Or,
mwp.icsServer = http://proxyserver.ibm.com:80/map/ics
instead of
mwp.icsServer = http://mapserver.ibm.com:9080/map/ics
Also if the MAP URL is included in asset group policies, the URL should be changed to the URL of the proxy server and the asset group policies should be re-imported into the Multi-Channel Server database.
# *** START NEW MAPPING RULES SECTION ***
insert the following:
proxy /map/map* http://hostname:port/map/map_mode*
whereCacheQueries Always http:// hostname:port/map/map_mode*
where