Install > Installing or enabling additional software > Configure Social Commerce


Configure Social Commerce performance using disk caching

Social Commerce assets benefit from the caching provided by IBM HTTP Server. The IBM HTTP Server (IHS) supports disk caching using the mod_disk_cache module. Follow the instructions on this page to enable and configure disk caching with Social Commerce.


Before you begin

Configure Social Commerce


Procedure

  1. Enable the mod_disk_cache module:

    1. Open the Web server httpd.conf file in a text editor.

    2. Add the following directives to the file:

      LoadModule cache_module modules/mod_cache.so
      LoadModule disk_cache_module modules/mod_disk_cache.so

  2. Create a cache directory for the IBM HTTP Server disk cache.

    The cache directory must have:

    • Read and write permissions set for the user account under which IHS is running

    • Space on the file system to allow the cache to grow to its maximum size.

    For example, the following commands create a sample directory, cacheroot, on an AIX, Linux or Solaris operating system:

    % mkdir /opt/WebSphere/HTTPServer/cacheroot
    % chown nobody /opt/WebSphere/HTTPServer/cacheroot
    Refer to the operating system documentation for more information on creating directories and directory permissions.

  3. Add the caching directives to the VirtualHost elements for port 80 and port 443:

    1. Open the Web server httpd.conf file in a text editor.

    2. Find the caching directives for Virtualhost elements in the file for port 80 and 443. These elements will start and end with tags similar to the following examples:

      <VirtualHost myserver.myhost.com:80> </VirtualHost>
      <VirtualHost myserver.myhost.com:443> </VirtualHost>

      The following sample directives identify the location of the disk cache and specify that caching should be enabled for Social Commerce request URIs identified by the /soccom context root. The mod_cache module will examine the HTTP response headers to identify responses that can be cached according to the HTTP 1.1 specification.

      CacheRoot /opt/WebSphere/HTTPServer/cacheroot
      CacheEnable disk /soccom
      CacheLastModifiedFactor 0.5
      CacheIgnoreNoLastMod On
      CacheIgnoreHeaders Set-Cookie

      Tips: The following links are helpful when configuring IBM HTTP Server performance:

  4. Configure the cache expiration times as needed. Dynamic content from Social Commerce is served with two cache control directives, s-maxage and max-age.

    To use these two cache control directives:

    1. Edit...

      • WC_INSTALL/components/social-commerce/config/adapter.config

    2. By default max-age is set to 300 seconds and s-maxage is set to 1400 seconds. These values are configurable using the two configuration settings in the adapter.config configuration file. The two default values are shown in the following example:

      # Set the Cache-Control directive max-age
      /config/soccom/cache/cacheExpiration = 180
      # Set the Cache-Control directive s-maxage
      /config/soccom/cache/sharedCacheExpiration = 1440

  5. Run the following command whenever you have made changes to the adapter.config file:

    config_ant.sh -DinstanceName=instance -buildfile ../components/common/xml/enableFeature.xml -DfeatureName=social-commerce UpdateAdapterConfig


+

Search Tips   |   Advanced Search