π This article explains how to return a different HTTP status code than what was cached from your origin server. SpeedWorkers is part of Botify's Activation Suite, available as an option with a Botify Pro or Enterprise plan.
Overview
SpeedWorkers returns the same page and HTTP status code cached from your origin server by default. Sometimes, you may want SpeedWorkers to return a different HTTP status code. SpeedWorkers can override the HTTP code from your origin and replace it with another code, such as 404 or 301.
Modifying the Page Header
For each page that you want to serve a redirect, add the following content to the HTML header:
404
<meta name="page-status-code" content="404">
This method is helpful for a βsoft 404β (when you want to send a 200 HTTP response even though the page content is blank). When you know a certain URL no longer exists, deliver a static 4xx page instead.
301 redirect
<meta name="page-status-code" content="301">
<meta name="page-header" content="Location: https://www.example.com">
In the example above, replace https://www.example.com with the exact full URL of the location where you want to redirect, including the protocol (e.g., HTTP, HTTPS) and domain name. If you do not set the location, SpeedWorkers will ignore the 301 redirect.
Redirects are saved in the SpeedWorkers page inventory for the duration set for the page's cache behavior.
See also