I am developing a WordPress website using a minimalist JavaScript framework + Timber. I have noticed that between pages, there is about 1500ms delay. I wanted to use W3 Total Cache, or WP Super Cache to see if I can use the cache features so it can load the pages faster.
It does seem to be faster, however I have some rendering problems. Because i'm using Timber, I have partial templates, one example looks like this.
Contacts.twig
{% extends "_base.twig" %}
{% block content %}
{% if not isAJAX %}<section>{% endif %}
<div>
<div>
<section>
<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Necessitatibus quis doloribus libero et harum, molestiae, nam alias voluptatem sequi rem inventore aliquid reiciendis</p>
</section>
</div>
</div>
{% if not isAJAX %}</section>{% endif %}
{% endblock %}
When I activate W3 Total Cache, when I reload this page, http://example.com/contact, it only renders out this particular HTML strings, there is no header or footer, meaning it does not render out the _base.twig
.
In my contact.php
, it looks like
<?php
/**
* Template Name: Contact Template
*/
$context = Timber::get_context();
Timber::render('views/contact/contact.twig', $context);
Are there any Timber/WordPress experts who know how I can use W3 Total Cache correctly?
I had this issue too. I use Fast Velocity Minify along with W3 and it fixed my load speed issue. Below are some links that may work too. I finally reached a score of 90 for mobile and desktop after tweaking for a while. Let me Know if this works.
https://wordpress.org/support/topic/how-to-fix-render-blocking-java-script-in-wordpress/
Speed Booster Pack Plug In https://wordpress.org/support/topic/can-i-use-along-with-w3-cache/
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With