Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Template isn't being rendered

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?

like image 929
anon Avatar asked Jan 14 '17 14:01

anon


1 Answers

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/

like image 195
Tyler-- Avatar answered Oct 05 '22 22:10

Tyler--