S3 Storage

This article explains how to implement a cache class for storing and retrieving MathType cache from Amazon Simple Storage Service (Amazon S3).

MathType Integrations need to store two pieces of information in the server. By default, this information is stored in the file system:

  1. The inverse association <digest> to MathML. This data cannot be removed unless it exists a mechanism able to regenerate them.
  2. A cache with the images generated from MathML. This cache can be removed if necessary and it will be regenerated when formulas are displayed.

In order to use Amazon S3 for storing and retrievingMathTypecache it is necessary to implement com.wiris.plugin.storage.StorageAndCacheinterface interface. See server-side API for a description of the interface.

Amazon Web Services

The following examples show how to implement a S3 Storage class for Java, PHP, C# and Ruby technologies. These sample classes are fully functional. The following steps should be followed in order to run them.

  1. Change the S3 class bucket name constant.
  2. Change S3 class region endpoint.
  3. Fill in your AWS access credentials in the provided credentials file template, and be sure to move the file to the default location * (~/.aws/credentials) where the sample code will load the credentials from.
  4. Change the key wirisstorageclass of the configuration.ini to point to the S3 cache class. See the formula persistence section for more information.

Sample classes downloads