Enable Cloudflare integration on WordPress with LWS Optimize

Procédure

What is Cloudflare?

Cloudflare is a company offering various services on the Internet in terms of security, data protection and, above all, CDN (Content Delivery Network), a system responsible for delivering content from its servers to users.

The way a CDN works is simple: when a site is requested for the first time, it is stored on the CDN server, in this case Cloudflare, and then shared with all the other CDN servers (Cloudflare) in the world.
From then on, any user wishing to access this site will receive a copy from the nearest server instead of making a request to the site directly, whose servers could be on the other side of the world.

In this way, it takes less time for the request to be processed, significantly improving performance. What's more, since it's no longer the site that manages the requests but the CDN, bandwidth usage is reduced.

These reasons alone are enough to explain why so many sites put their trust in Cloudflare, but it still has an ace up its sleeve: as all requests pass through Cloudflare first, it can block DDoS-type attacks or even malicious IPs trying to access your site. It therefore provides an initial layer of security against the various attacks that could affect your site.

Enabling Cloudflare integration on LWS Optimize

If you're using Cloudflare and LWS Optimize on your site to improve performance, it's important to activate the Cloudflare integration option so that the two services are synchronised and compatible.

LWS Optimize offers a dynamic cache (LWS Cache) and CSS/JS minification options, which conflict with Cloudflare, which also offers minification and its own cache. To avoid these conflicts, the integration will deactivate certain options in the extension.

To activate this integration, go to the extension's settings, then to the "CDN" tab. Here, check the "Cloudflare integration with LWS Optimize'" box. In the window that appears, enter your Cloudflare API Token. To create a token, you'll need to go to your Cloudflare account.

Creating an API token for Cloudflare

To create an API token, go to https://dash.cloudflare.com/ and log in to your Cloudflare account.
Then click on the icon at the top right and then on "My profile" to access your profile.

Enable Cloudflare integration on WordPress with LWS Optimize

From here, click on "API Tokens" in the left-hand menu to open the Tokens page.

Enable Cloudflare integration on WordPress with LWS Optimize

On the page, click on the "Create a token" button:

Enable Cloudflare integration on WordPress with LWS Optimize
Finally, in the list of token templates, find "WordPress" and click on the "Use a template" button.

Enable Cloudflare integration on WordPress with LWS Optimize

The configuration that is now displayed has been pre-filled for you, with the exception of the "TTL" field, which allows you to define the time for which the token will be valid. Start it at today's date and choose the token's expiry date. You can make it expire in several years if you don't want to repeat the operation frequently.

Enable Cloudflare integration on WordPress with LWS Optimize

Click on the "Continue to summary" button to obtain a summary of the token's contents.

Enable Cloudflare integration on WordPress with LWS Optimize

Finally, click on "Create a token" to complete the creation of the token.

Enable Cloudflare integration on WordPress with LWS Optimize

Once the token has been created, copy it and keep it safe: if you lose it and need it later, you will need to recreate a new token.
If you know how to use a command terminal, you can copy the command displayed on the page to test your token. If it works, you should be able to read "This API Token is valid and active" in the command returns.


Setting up the Cloudflare integration

Back on the Cloudflare integration window, enter your newly created token in the field and proceed to the next step.

Enable Cloudflare integration on WordPress with LWS Optimize

On the next page, you can choose whether or not to disable CSS/JS minification so as not to create conflicts with Cloudflare, which also offers these services. The dynamic cache (LWS Cache) must be deactivated in favour of Cloudflare's cache.
Make your choice and go on to the next step.

Enable Cloudflare integration on WordPress with LWS Optimize

On the next page you can change the lifetime of the Cloudflare cache. You can change this so that the cache is emptied at the most opportune moment, for example at the same time as the LWS Optimize file cache purge. This will prevent the caches from being flushed incorrectly and your site from displaying the wrong versions of pages.

Enable Cloudflare integration on WordPress with LWS Optimize

The last step asks you to confirm your choices. Click on the "Finish" button to apply the changes and activate the integration.

Enable Cloudflare integration on WordPress with LWS Optimize

Now that the Cloudflare integration is activated, during an automatic cache purge (if enabled), the Cloudflare cache will also be deleted so that your visitors can see the most recent data.

Conclusion

You now understand the benefits of Cloudflare for the performance and security of your site and know how to :

  • Configure the integration between Cloudflare and LWS Optimize for optimum synergy.
  • Create a Cloudflare API token for secure service management.
  • Configure the Cloudflare integration with LWS Optimize tools to avoid conflicts and optimise cache management.

Thanks to these steps, your site should benefit from a significant improvement in terms of loading speed and security, while offering you simplified management of caches and resources. 😊🌐

We hope this article has been helpful and provided you with all the information you need to get the most out of Cloudflare and LWS Optimize. Thank you for reading and please feel free to share your experiences or ask any questions you may have by leaving a comment below. Your feedback is valuable to us! 👍💬

Rate this article :

This article was useful to you ?

Article utileYes

Article non utileNo

Vous souhaitez nous laisser un commentaire concernant cet article ?

Si cela concerne une erreur dans la documentation ou un manque d'informations, n'hésitez pas à nous en faire part depuis le formulaire.

Pour toute question non liée à cette documentation ou problème technique sur l'un de vos services, contactez le support commercial ou le support technique

MerciMerci ! N'hésitez pas à poser des questions sur nos documentations si vous souhaitez plus d'informations et nous aider à les améliorer.


Vous avez noté 0 étoile(s)

Similar articles

2mn reading

How do I install the LWS affiliate plugin on WordPress?

3mn reading

How do I install the LWS SMS plugin for WooCommerce on WordPress?

0mn reading

How do I clean my WordPress site with LWS Cleaner?

0mn reading

How can LWS tools make managing WordPress easier?


Ask the LWS team and its community a question