Skip to content
This repository was archived by the owner on Jul 22, 2026. It is now read-only.

Latest commit

 

History

42 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Warning

This plugin has been abandoned.


icon

Fetch plugin for Craft CMS

Why this plugin is retired

Fetch made synchronous, uncached HTTP requests during Twig rendering. That was a convenient shortcut in 2018, but it's now a well-documented performance anti-pattern: every page render blocks on the external API, and if that API slows down or goes down, so does your site. Craft can also now do everything this plugin did natively, with no plugin installed.

Migrating away from Fetch

Option 1: Native Twig (direct replacement)

Guzzle ships with Craft, and Craft's create() Twig function can instantiate it — no plugin required. This is a drop-in replacement for what Fetch did:

{% set client = create('GuzzleHttp\\Client') %}

{% set response = client.request('GET', 'https://api.example.com/endpoint', {
    timeout: 5,
    http_errors: false,
}) %}

{% if response.getStatusCode() == 200 %}
    {% set data = response.getBody().getContents() | json_decode %}
{% endif %}

Note that this has the same drawback Fetch had: it blocks the render. If you use it, wrap the output in a {% cache %} tag at minimum.

Option 2: Do it properly (recommended for production)

  • Server-side data: fetch in a custom module/service and cache the result, keeping HTTP out of the render path entirely.
  • Async partials: use Sprig or htmx to load API-driven fragments after first paint.
  • Non-critical or personalized data: fetch client-side in JavaScript.

Option 3: Maintained plugin alternatives

  • Consume by Verbb — commercial; built-in caching, OAuth/credential management in the control panel, JSON/XML/CSV/HTML parsing.
  • Simple Guzzle — free; template-level requests with caching.

Thanks

Thanks to Luke Youell for creating this plugin, and to everyone who used and contributed to it over the years.

About

Utilise the Guzzle HTTP client from within your Craft templates.

Resources

Stars

23 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages