62
Chapter 8
Configuring the cache
In the following example, content from the domain
hp.com
is stored on partition 1 and 2, while content
from
www.yahoo.com
is stored on partition 3.
domain=hp.com partition=1,2
hostname=www.yahoo.com partition=3
5. Assign a generic partition to use for content that does not belong to any of the origin servers or domains
listed in the file. If all partitions for a particular origin server become corrupt, Traffic Server will also use
the generic partition to store content for that origin server.
Enter the following line in the
hosting.config
file:
hostname=* partition=list_of_partition_numbers
where
list_of_partition_numbers
is a comma-separated list of the partitions on which you want to
store the content that belongs to all other origin servers and domains not listed in the file.
6. Save and close the
hosting.config
file.
7. Run the following command to apply the configuration changes.
traffic_line -x
8. Restart the traffic server with the command
start_traffic_server.
Clearing the cache
When you clear the cache, you remove all data from the entire cache. You should clear the cache before
performing certain cache configuration tasks, such as partitioning.
To clear the cache:
1. Stop the Traffic Server using the command
stop_traffic_server
.
2. Enter the following Traffic Server command and press Return.
traffic_server -Cclear
3. Enter the following command to restart Traffic Server.
start_traffic_server
NOTE
If you want to allocate more than one partition to an origin server or domain, you
must enter the partitions in a comma-separated list on one line as shown in the above
example. The file cannot contain multiple entries for the same origin server or
domain.
IMPORTANT
Save your current Traffic Server configuration before you clear the cache by taking a
snapshot of your configuration (refer to
The Snapshots button‚ on page 76
).
CAUTION
The
clear
command deletes all data in the Traffic Server cache. You are not
prompted to confirm the deletion.