Skip to content
This repository has been archived by the owner on Jan 27, 2023. It is now read-only.

onedesign/craft-fastly

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 

Repository files navigation

Fastly integration plugin for Craft

This plugin helps integrate Fastly caching with Craft.

What it does

  • Adds the neccessary headers to your pages to enable Fastly caching.
  • Listens for Entries to be saved and tells your Fastly app to invalidate its caches.

Installation

To install, follow these steps:

  1. Upload the fastly/ folder to your craft/plugins/ folder.
  2. Go to Settings > Plugins from your Craft control panel and enable the Fastly plugin.
  3. Open the settings for the plugin and add your Fastly account details
  4. You'll likely also need to make some updates to your server and Fastly settings as outlined in this document.

Usage

If you'd like to clear the cache from another location in your craft install, you can purge the cache directly like so:

craft()->fastly->purgeFastlyCache()

This will return a boolean value that tells you whether the cache successfully cleared or not. If it fails, Fastly will log the Status Code into fastly.log.

Templating

To add the necessary headers to your templates, just add the following to the very top of your _layout.html template:

{{ craft.fastly.headers }}

Releases

No releases published

Packages

No packages published