Wilcity Optimization


  1. Since version 1.0.6, We moved Wiloke Optimization out of Wiloke Tools, You will see the Wiloke Optimization menu right on the admin sidebar instead.
  2. After upgrading to 1.0.6, please go to Wiloke Optimization -> General Settings -> Re-enter Local Directory and press the Save Changes button.

All about how to Speed up your Website at the best.

For a long time, our team have read and learnt a lot about optimizing website speed. With all experience, we have finally developed Wilcity Optimization plugin. When using in our website, this plugin has increased the web speed up to 10 times. The loading time decreases from ~1600ms to ~150ms and sometimes ~2ms (800 times faster). You can check the speed at https://wilcity.com/, the website only use one caching plugin.

Wiloke Optimization is so different from other cache plugins!

  • Other plugins often skip caching REST API (because these API can contain some sensitive information). But Wiloke Optimization is designed for Wilcity so we know which API is safe to be cached and which API is not.
  • Wiloke Optimization can remedy a problem but other plugins can’t that is: the Admin Bar shows up although users aren’t logging in. It’s because when a user logs in, Cache will save a version (that includes the Admin Bar of logged-in user) then when another user visits your website without logging in, it will get the cache and display Admin Bar. But Wiloke Optimization plugin has successfully remedied this problem.
  • Special Function only for Wilcity: Whenever users hover at a position, the nearby links will be preloaded and cached so that if users click on a link, it will load super fast.
  • Some facts from statistics:
    • Nearly 50% of users expect a load time of 2 seconds or less.
    • If a website loading exceeds more than 3 seconds, then you can expect roughly 40% of your web traffic to leave.
    • Customer satisfaction reduces significantly during web page loading delays.

Now let’s go into the ways we can speed up our website with 2 types of cache:

  1. Server Cache: The cache saved by website’s server
  2. Client Cache: The cache saved by users’ browser.

Before You start

  1. Go to Plugins -> Looking for Wilcity Service Client -> If the current version is smaller than 1.1.8, please Deactivate and Delete this plugin, then re-install with the newest version https://github.com/wilokecom/wilcityservice-client
  2. Click on Wilcity Service from the sidebar -> Update to latest version of Wilcity

1. Server Cache:

1.1 Wiloke Optimization plugin

Wiloke Optimization is a cache plugin which will make theme to fetch all the links and create static HTML pages. This plugin could work with other themes but we recommend Wilcity theme for the best optimization.

From your admin menu, go to Wilcity Service –> you will see Wiloke Optimization plugin, click on “install plugin” then click “activate“.

Now, go to Wiloke Tools –> Wiloke Optimization.

General Settings tab

  • Local Directory: where the static HTML files will be located. This folder is positioned on the same level with folder “wp-content” in your hosting server.
  • Enable Static Pages for custom post types: Decide which post types the plugins will work on. Only post types enabled here will be saved static page versions.
  • Exclude the links contain: If a link contains the texts/rules in here, that link won’t be saved as a static page.

Generate Static Pages tab

Next, click on tab “Generate Static Pages“. Then click on button “Generate Static Pages” – Wiloke Optimization plugin will do its own set-up, just wait a little bit.

When we see the text “Generating Static Pages” as in below, that means now you can close the browser and the plugin can start doing its job by itself.

But you can still check whether the plugin is working well by going inside the folder (in your hosting server) that you’ve chosen before at the tab “General Settings — Local Directory. If there appears more files in that folder that means the plugin has worked. If not, set chmod 755 for the folder.

In case you want to stop creating static pages immediately, click on button “Cancel“. And, button “Delete Static Pages” will delete all static pages have been created.

When I create/delete/update a listing, do I have to update the cache?
No. If a page has some changes, the cache will be automatically updated right after one minute!

Admin Bar

The admin bar is a floating bar that contains useful administration screen links such as add a new post, see pending comments, edit your profile etc.

However, the Admin Bar may show up even We are not logged in if you are using a Cache plugin / CDN (because the cache may be generated when You are logged in)

Luckily, Wilcity provides a solution to resolve the issue:

  1. Click on Appearance -> Theme Options
  2. Navigate to Users -> Show admin bar
  3. Select Wiloke Optimization AdminBar

1.2 NGINX server

We recommend using Nginx server (and some instructions below are for Nginx only). If you don’t use Nginx, please:

  • Check your web speed by going to your website: then right-click –> choose Inspect –> choose tab Network –> press F5. Then you will see the result in the column Time. If the result is <1000ms, you can keep using your current server.
  • But if it’s >1000ms, we recommend you use Nginx for better performance. To switch to Nginx server, you can read at here.
  • Of course, we’re talking about server that means you’re not using a shared hosting. We hope that you’re using a VPS or at least a cloud hosting. Some providers we recommend are Cloudways and DigitalOcean.

If you don’t know much about server, you can get us to do the job at Wilcity Optimization Service. Every beloved customer of the service will also receive a 50% discount coupon for Wilcity Bundles (all of our premium plugins).

Now, logging in your Nginx server with SSH.

Turn on Gzip Module:

Open file nginx.config (often located in /etc/nginx/nginx.conf) and copy paste the code below:

# reduce the data that needs to be sent over network -- $
gzip on;
# gzip_static on;
gzip_min_length 10240;
gzip_comp_level 1;
gzip_vary on;
gzip_disable msie6;
gzip_proxied expired no-cache no-store private auth;

Setup Try Static File

Under folder sites-enabled, open your domain-config file. Then paste the code below under Server Context:

# type YOUR local directory that you set in Wiloke Optimization plugin. DONT include the slash / at LAST.
set $localdirectory "/wilcity-cache"; 
location = / {
        try_files $localdirectory$args/index.html $uri $uri/ /index.php?$args;
location / {
        try_files $localdirectory$uri$args $localdirectory$uri$args/index.html $uri $uri/ /index.php?$args;
  • $localdirectory: replace “/wilcity-cache” by “your local directory” (that you’ve set in Wiloke Optimization plugin –> tab General Settings –> Local Directory) – remember to NOT include the slash / AT LAST.
  • Explain: When a user requests a link, the Nginx server will check if the static page of this link has existed or not. If it has existed, Nginx will use the existing static page. If not, PHP will do the normal job.

2. Client Cache:

Using CloudFlare

  • Firstly, please follow the instructions here to add Cloudflare to your website.
  • Secondly, follow the instructions here to create Global API.
  • Next, go to Wiloke Tools -> Wiloke Optimization -> CloudFlare and fill in your Global API key.
  • Finally, in Cloudflare website –> click on Page Rules then add configurations like images below (please look carefully):

❓ Do I need to use other cache plugins when using Wiloke Optimization?
No. You don’t need to use other cache plugins. In fact, we shouldn’t use 2 cache plugins at the same time.

3. Wilcity Optimization Service

Our service not only does all the optimization configs above for you, but also includes:

  1. Website Speed Audit:
    • We find out elements still slowing down your website.
    • Setup your hosting server for the best speed optimization.
    • Minify scripts of your website.
    • Setup Wiloke Optimization plugin.
    • Setup Cloudflare config for your web.
  2. Performance Testing:
    • We will use GTmetrix to optimize your website more for a better speed.

You always have us do the job at Wilcity Optimization Service. Every beloved customer of the service will get a 50% discount coupon for when they want Wilcity Bundles (containing all of our premium plugins) to get the full Wilcity world.

Leave A Comment?