• Home
    • English
    • 中文
  • About Us
  • Services
    • SEO Services
    • Website Design Service
  • Projects
  • Docs
  • Blog
    • Affiliate
    • Ecommerce
    • Frontend
    • linux
      • nginx
    • PHP
      • Magento
      • wordpress
    • Python
    • SEO
    • Web
  • Contact Us

Subscribe to Updates

Get the latest creative news from FooBar about art, design and business.

What's Hot

Design a plugin for wordpress woocommerce to display a tab to show attachment download

2024-04-06

TranslatePress v2.6.9 – WordPress Translation Plugin

2023-12-25

A Linux batch script converting pictures to webp format

2023-07-10
Facebook Twitter Instagram
  • 中文
  • English
Facebook Twitter Instagram Pinterest VKontakte
Weilai Tech Weilai Tech
  • Home
    • English
    • 中文
  • About Us
  • Services
    • SEO Services
    • Website Design Service
  • Projects
  • Docs
  • Blog
    • Affiliate
    • Ecommerce
    • Frontend
    • linux
      • nginx
    • PHP
      • Magento
      • wordpress
    • Python
    • SEO
    • Web
  • Contact Us
Weilai Tech Weilai Tech
Home»PHP»Using WP Super Cache with IIS 7
PHP

Using WP Super Cache with IIS 7

OxfordBy Oxford2021-05-01No Comments3 Mins Read
Facebook Twitter Pinterest LinkedIn Tumblr Email
Share
Facebook Twitter LinkedIn Pinterest Email
If you are lucky enough to have attracted some traffic on your WordPress blog, you may find yourself stuck with an overloaded web server that gets bombarded from links on Google, Digg or Twitter.

Tags: iis infrastructure seo wordpress

  • Overview
  • Prerequisites
  • Installing the Plug-in
  • Configuring URL Rewriting
  • Enabling Caching in WordPress
  • Activating the Plug-in

Overview

Sooner or later you will discover the WP Super Cache plug-in for WordPress, but perhaps you’re running it on IIS 7 instead of Apache, and support for that is somewhat limited. Luckily, a two year old blog post on IIS Blogs still appears to work for the latest version of WordPress (3.0.1 at the time of this writing) and IIS 7.5, so that they will be presented here again in a somewhat condensed form.

Prerequisites

The steps below make the following assumptions:

  • The web server has the Microsoft URL Rewrite Module 2.0 installed
  • WordPress has Pretty Permalinks enabled.

Installing the Plug-in

The quickest way to install the plug-in is to use the plug-in manager in WordPress:

  1. Log on to your WordPress blog as administrator
  2. In the navigation menu, click Plugins → Add New
  3. Search for the term WP Super Cache
  4. Click Install Now in the search result for WP Super Cache.

Configuring URL Rewriting

WP Super Cache uses URL rewriting to redirect external requests to your blog posts and pages to a separate directory that contains static HTML and GZIPed pages. These static files are automatically created and maintained by the plug-in, and they are the reason for the blog’s improved performance, because they do not require PHP and database execution.

The WP Super Cache plug-in has been written for the Apache web server and will attempt to create and update .htaccess files within your WordPress installation, but those files have no effect when using IIS as the web server.

To configure URL rewriting for IIS, perform the following steps:

  1. Open the Web.config file in a text editor
  2. Add the following block right after the <rules> section near the top of the file and before the <rule> entry for the WordPress Pretty Permalinks configuration:
    <rule name="WP Super Cache" stopProcessing="true">
    <match url="^(\d{4})/(\d{2})/(.+?)/?$" ignoreCase="false" />
    <conditions>
      <add input="{REQUEST_METHOD}" negate="true" pattern="POST" ignoreCase="false" />
      <add input="{QUERY_STRING}" negate="true" pattern=".*=.*" ignoreCase="false" />
      <add input="{QUERY_STRING}" negate="true" pattern=".*attachment_id=.*" ignoreCase="false" />
      <add input="{HTTP_COOKIE}" negate="true" pattern="^.*(comment_author_|wordpress|wp-postpass_).*$" ignoreCase="false" />
      <add input="{DOCUMENT_ROOT}\wp-content\cache\supercache\{HTTP_HOST}\{R:1}\{R:2}\{R:3}\index.html" matchType="IsFile" />
    </conditions>
    <action type="Rewrite" url="wp-content/cache/supercache/{HTTP_HOST}/{R:1}/{R:2}/{R:3}/index.html" />
    </rule>
  3. Save and close the file.

The rules shown above apply to Pretty Permalinks in the Year/Month/Title format, for example http://blog.gerke-preussner.de/2010/11/using-wp-super-cache-with-iis-7-2/, and they will have to be adjusted for different Permalink formats.

Enabling Caching in WordPress

To enable serving cached WordPress files, make the following changes in the WordPress configuration file:

  1. Open the file wp-config.php from the root directory of your blog in a text editor
  2. Add the following line before the first require_once() function call at the bottom of the file:
    define('WP_CACHE', true);
  3. Save and close the file.

Activating the Plug-in

Finally, the plug-in can be activated in the WordPress administration interface:

  1. In the navigation menu click Settings → WP Super Cache
  2. Click on WP Super Cache
  3. On the Advanced tab…
    • Check Cache hits to this website for quick access
    • Select Use mod_rewrite to serve cache files.

The warning messages about Mod rewrite may not be installed and Rewrite rules must be updated apply to the Apache web server and can be ignored.

The plug-in should now be fully functional, and cached versions of the blog posts and pages should automatically be created in the \wp-content\cache\supercache directory. Please note that the plug-in will create sub-directories for each year, month and page.

Share. Facebook Twitter Pinterest LinkedIn Tumblr Email
Avatar photo
Oxford

Related Posts

how to Set up a multisite via Drupal8?

2021-06-25

Drupal theme development

2021-06-17

Use the Windows Cache Extension for PHP

2021-05-01

php7.3 pregmatch problem

2021-04-26
Recent Posts
  • Design a plugin for wordpress woocommerce to display a tab to show attachment download
  • TranslatePress v2.6.9 – WordPress Translation Plugin
  • A Linux batch script converting pictures to webp format
  • Hearing aid listed company official website SEO case
  • how to use docker to run php5.6 plus apache
May 2021
M T W T F S S
 12
3456789
10111213141516
17181920212223
24252627282930
31  
« Apr   Jun »
Tags
app branding design digital Docly docs etc faq fix github Helpdesk Image issue magento Manual marketing memecached Photography planing seo sequrity tips Travel ui/ux web WordPress 爬虫
Editors Picks
About Us

Guangzhou Weilai Technology is a foreign trade integrated marketing service provider focusing on Google as the drainage center and marketing self-built website as the carrier.

Email Us: [email protected]
Contact: +86 18676917505

Facebook Pinterest YouTube LinkedIn
Recent Posts
  • Design a plugin for wordpress woocommerce to display a tab to show attachment download
  • TranslatePress v2.6.9 – WordPress Translation Plugin
  • A Linux batch script converting pictures to webp format
  • Hearing aid listed company official website SEO case
  • how to use docker to run php5.6 plus apache
From Flickr
Website Design Case
© 2024 Copyright by Guangzhou Weilai Technology Co.,Ltd..
  • Home
  • About Us
  • SEO Services
  • Website Design Service
  • Projects
  • Blog
  • Contact Us

Type above and press Enter to search. Press Esc to cancel.