Catalogs And CSV Files Prevent Reparsing

Problem

If a Catalog's Source was set to a CSV File, the file is parsed by default on each access. Depending of the file size and number of calls, this can be a very expensive task. To prevent this, make use of a Cache Filter.

Solution

Source Type is a File

As a first step, let's define a variable and assign the file path to it (to prevent redundancy).

CSV Screenshot 1

Figure 1: Variable Definition

Next, set the CSV File as the Source Type, and provide the file path.

Then add a Cache Filter and set its Expiration Expression as indicated in fig. 2.

CSV Screenshot 2

Figure 2: Catalog Configuration

Source Type is a Resource

Choose Resource as the Source Type, and set the CSV File as the Resource.

Then add a Cache Filter and set its Expiration Expression as indicated in fig. 3.

CSV Screenshot 3

Figure 3: Catalog Configuration (resource)