<commit_before>When adding a SilverStripe installation to a content delivery network, or a grid server (such as MediaTemple's [[http://mediatemple.net/webhosting/gs/|(gs) Grid Service]]), some additional problems present themselves. These are listed below.

Please update this page if you have any more information.

====== Template cache directory not shared between all servers ======
**Note:** This may or may not be specific to MediaTemple's (gs) Grid Service offering. Email Matt (matt [at] silverstripe.com) for more information.

The grid service I used only shared a number of directories, and not the entire filesystem. One of the directories that wasn't shared was /tmp, which means that every server had to generate (or re-generate in the case of running ?flush=1) the template cache. This led to SilverStripe loading very slowly quite often, and sometimes (when you retrieve a page from a server which has already cached the files) loading at normal speed.

My solution was to move the silverstripe-cache directory out of /tmp and into the domains/domain-name.com directory that was shared between all servers. This meant that I had to hack sapphire/core/Core.php to allow me to set a TEMP_FOLDER directory that wasn't in the web-root (for security reasons), but still outside of /tmp.

There's a ticket to make the temp folder a little easier to change here: http://open.silverstripe.com/ticket/2121<commit_msg>Headings<commit_after>====== Content Deliverty Networks ======

When adding a SilverStripe installation to a content delivery network, or a grid server (such as MediaTemple's [[http://mediatemple.net/webhosting/gs/|(gs) Grid Service]]), some additional problems present themselves. These are listed below.

Please update this page if you have any more information.

===== Template cache directory not shared between all servers =====
**Note:** This may or may not be specific to MediaTemple's (gs) Grid Service offering. Email Matt (matt [at] silverstripe.com) for more information.

The grid service I used only shared a number of directories, and not the entire filesystem. One of the directories that wasn't shared was /tmp, which means that every server had to generate (or re-generate in the case of running ?flush=1) the template cache. This led to SilverStripe loading very slowly quite often, and sometimes (when you retrieve a page from a server which has already cached the files) loading at normal speed.

My solution was to move the silverstripe-cache directory out of /tmp and into the domains/domain-name.com directory that was shared between all servers. This meant that I had to hack sapphire/core/Core.php to allow me to set a TEMP_FOLDER directory that wasn't in the web-root (for security reasons), but still outside of /tmp.

There's a ticket to make the temp folder a little easier to change here: http://open.silverstripe.com/ticket/2121
{'fraction_non_alphanumeric': 0.06729101630246272, 'fraction_numerical': 0.00346860908775581, 'mean_word_length': 4.710891089108911, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3854265', 'n_tokens_mistral': 738, 'n_tokens_neox': 705, 'n_words': 419}