Home User profile
tagDiv Member
This user did not write anything. So we are just showing here some random text to make the profile page look nice :)
Atelier Shen
tagDiv Member

Hi @soaresrey,

This is caused by lacking of php-xml extension. You show install it on your server and restart apache or php-fpm ( if your are using nginx ). Hope this helps!

Atelier Shen
tagDiv Member

Hi Ginfox,

I have found a solution on WordPress.org forum, post by staff of SG. You can try this out:


function add_vary_header($headers) {
$headers['Vary'] = 'User-Agent';
return $headers;
}
add_filter('wp_headers', 'add_vary_header');

Add code above to your function.php file in Newspaper-Child theme folder. This will make different cache for each device.

Sorry I didn’t use SiteGround for a long time, so I’m not able to test for you. But I guess you may reply to https://wordpress.org/support/topic/configure-mobile-theme-for-supercacher-siteground/ if you need further support.

Happy Coding!

Atelier Shen

Atelier Shen
tagDiv Member

Hi Simon,

I have figured out the solution, provide as below:

When you set a FastCGI cache, make sure add a variable to specify agent, for now I’ll use $mobile_request

And we can add the code to http block:


set $mobile_request 0;

    if ($http_user_agent ~* "(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino") {
        set $mobile_request '1';
    }

    if ($mobile_request = '1') {
        set $skip_cache 1;
    }

next, find your fastcgi_cache_key section,
then add $mobile_request to the end of code.

For example:


fastcgi_cache_key "$scheme$request_method$host$request_uri$mobile_request";

This should be working, just remember to reload the NIGNX server.

Hope this helps.

Viewing 3 posts - 1 through 3 (of 3 total)