Extension, Module

Archived
Forum
(read-only)

CE Cache

ExpressionEngine 2, ExpressionEngine 3

Back to this add-on's main page
View Other Add-ons From Causing Effect

     

CE Cache not caching publisher translated pages correctly

Support (Resolved)

Emagine Media
Emagine Media

Hi Aaron,

I’m in the process of upgrading an EE2 site to EE4.3.1

I have CE Cache 2.0.2 installed.

I have Publisher 2.8.3 installed.

I have two language sets, en (English), and ga (Gaeilge).

Initially, I wanted to use the static caching driver, but the htaccess rules broke compatibility with low search. Then I settled for using the “exp:ce_cache:it” tags with the file caching driver. This is the only driver in use.

With caching enabled and the plain ce_cache:it tag, it caches the english version of pages, and then the translations will not work, the page is cached and that’s it.

If I add:

{exp:ce_cache:it url_prefix="{publisher:current_language_code}"

Then it will add a separate /ga and /en cache folder for each page, with a separate item within each. The English page functions as normal, the Irish page is completely blank, see examples below, I’ve reduced the amount of html in the en example, but it is a full page and these pages function as intended without CE Cache.

/en

a:3:{s:3:"ttl";i:2419200;s:4:"made";i:1531901885;s:7:"content";s:33420:"
<section class="
c-hero">
            <img class="
c-hero__image" src="/images/made/uploads/images/page_headers/header-1.jpg">
            <div class="
c-hero-content">
                <div class="
row c-hero-content-inner">
                    <div class="
columns small-12">
                        <h1 class="
c-hero__title">
                        
                            English Hero Title
                        
                        </h1>
                        <div class="
c-hero__text"></div>
                    </div>
                </div>
            </div>
        </section>
"
;

/ga

a:3:{s:3:"ttl";i:2419200;s:4:"made";i:1531901900;s:7:"content";s:23:"





    
    

    

"
;

If I try this instead:

{exp:ce_cache:it id="{publisher:current_language_id}" seconds="2419200"

Then it will add 2 files per page, each with a unique id, both in the same directory. Again, the English page is fine, the Irish page is completely blank.

I’ve also tried a combination of the two, but that just ensures the /ga and /en folders have unique ids per item rather than being named item.

I see other people have had similar issues in the past, but I haven’t been able to find a resolution. Most of the posts I’m finding are dated around 2013 (Similar) I’ll be mentioning the issue with boldminded support also as I’m not 100% sure of where the issue is originating.

Thanks,
Sam

Emagine Media
# 1
Emagine Media

Here’s the solution that matches our case for anyone else who comes across the same issue:

This works perfectly to separate the multiple language pages into their own divided sections within the cache:

{exp:ce_cache:it url_prefix="{publisher:current_language_code}"

Our issue was publisher tag specific. While using standard ee segment tags worked perfectly sitewide, once caching was enabled, it broke the site.

We have replaced all:

{segment_1}{segment_2}{if segment_2 == "test"}url_title="{segment_2}" and so on... 

with

{publisher:segment_1}{publisher:segment_2}{if publisher:segment_2 == "test"}url_title="{publisher:segment_2}" and so on... 

That’s it. You can close this ticket.