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.

Activate 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, enter advanced mode by clicking on the dedicated button and then on the 'CDN' tab. Here, tick 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 have 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

If your token is valid, you'll be redirected to a second screen, with a summary of your CloudFlare information. A reminder of the changes made is also displayed on the modal. If you're happy with this, click "Finish" to save 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 in order to display the most recent data to your visitors. If you change the lifetime of the file cache, this change will also be reflected in Cloudflare.

Conclusion

You now know how to :

  • Understand the usefulness and operation of Cloudflare and its CDN to improve the performance and security of your site.
  • Enable Cloudflare integration with LWS Optimize to synchronise services and avoid cache and minification conflicts.
  • Create a Cloudflare API token to secure and manage access to your Cloudflare configuration from third-party services.
  • Configure Cloudflare integration correctly in LWS Optimize and understand the automatic adjustments applied to your cache.

🚀 With this knowledge, you're ready to boost your site's performance while providing an extra layer of protection against online threats. 🛡️ Don't forget that optimising your site is an ongoing process that requires regular attention to maintain fast load times and a smooth user experience. 😊

Thank you for reading this article! If you have any questions or would like to share your experience with Cloudflare and LWS Optimize, please feel free to leave a comment below. Your feedback is valuable to us and the community! 📬👥

Rate this article :

5/5 | 1 opinion

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

0mn reading

How can I minimize the files on my WordPress site with LWS Optimize?

0mn reading

How can I combine the files on my WordPress site with LWS Optimize?

0mn reading

How do I preload CSS files on my WordPress site with LWS Optimize?

0mn reading

How do I disable WordPress emojis with LWS Optimize?


Ask the LWS team and its community a question