Home


Modify the WCS instance to handle "double clicks"

When a user clicks on cacheable link A and then cacheable link B, DynaCache creates two placeholder entries with different cache keys (one for A and one for B). By default, in WebSphere Commerce, if the user clicks on B before A can return, then a feature called "DoubleClickHandler" will drop request B and process only request A. The result is that both the DynaCache placeholders wrongly end up being filled with the response to A.

The solution is to selectively disable DoubleClickHandler for certain commands in the WCS instance_name.xml file. Make a backup copy before the file is edited.

When switching between non-SSL and SSL requests, the parameters are encrypted. Encryption must be suppressed so that the parameters in the cachespec.xml file are used. To suppress the encryption, make the following changes to the file:

  1. Open the <wc_instance_name>.xml file (in our case demo.xml) in a text editor.

  2. Search for the following text:
    </ProtectedParameters>
    

  3. Add the following text immediately below it:
    <NonEncryptedParameters>
    
    <Parameter name="storeId" /> <Parameter name="langId" /> <Parameter name="catalogId" /> <Parameter name="productId" />
    </NonEncryptedParameters>
    

    The default instance creation enables an option named DoubleClickHandler. This option is used to handle multiple requests for the same command from the same user. This code does not work well with dynamic caching. It must be selectively disabled on a command basis. For the purposes of this example it has been disabled for the commands CategoryDisplay, ProductDisplay, TopCategoryDisplay, and StoreCatalogDisplay, as shown in the next steps.

  4. Add the following text below </NonEncryptedParameters>:
    <DoubleClickMonitoredCommands>
    
    <excludeCommands> <command name="CategoryDisplay" /> <command name="ProductDisplay" /> <command name="TopCategoryDisplay" /> <command name="StoreCatalogDisplay" /> </excludeCommands>
    </DoubleClickMonitoredCommands>
    

  5. Save your changes and close the text editor.

+

Search Tips   |   Advanced Search