• Resolved tanmaymeh

    (@tanmaymeh)


    Hello there, thank you for this amazing plugin. So, I have a wordpress website hosted in aws with two EC2 instances and load balancer. I am using elasticache(memcached) for caching. I installed w3 total cache plugin and did all set up.

    My website have different nav menu for mobile and desktop, now the problem is: when I visit my website from mobile, some times(you can check by refreshing 2-3 times) it shows the mobile version menu and some it desktop version menu and same goes to desktop. How can I solve this? Could you please guide me to the right direction?

    Thank you.

    The page I need help with: [log in to see the link]

Viewing 8 replies - 1 through 8 (of 8 total)
  • Plugin Contributor Marko Vasiljevic

    (@vmarko)

    Hello @tanmaymeh

    For this, you can use User Agent Groups and make sure that a unique cache is created for each user agent.
    In Performance>Cache Groups>Manage User Agent Groups, you can Create (or simply enable the existing) a group of user agents by specifying names in the user agents field. Assign a set of user agents to use a specific theme, redirect them to another domain, or if an existing mobile plugin is active, create user agent groups to ensure that a unique cache is created for each user agent group. Drag and drop groups into order (if needed) to determine their priority (top -> down).
    If you are not using any AMP, the only thing that you need to do is Enable both Groups (High and low), and select the theme that you are using in the dropdown menu to ensure that a unique cache is created for each user agent group. Drag and drop groups into order (if needed) to determine their priority (top -> down).

    The two default User-Agent Groups are covering all notable groups. If you wish to add any other you can do so by Specifying the user-agents for these groups. Remember to escape special characters like spaces, dots, or dashes with a backslash. Regular expressions are also supported.
    Make sure to save all settings and purge the caches once the groups are enabled.

    Thanks!

    Thread Starter tanmaymeh

    (@tanmaymeh)

    Hi there, thank you for your suggestion and quick response. So, I am using only one theme and there is no plugin for switching mobile or desktop version. My theme displays different navigation menu based on user agents.

    So, I just want different version of cache for mobile and desktop. And for this I went to Cache Groups and just checked the tablets and phones group as shown in the screenshot below. Is there anything other to setup?

    Plugin Contributor Marko Vasiljevic

    (@vmarko)

    Hello @tanmaymeh

    Thank you for your feedback.
    Just select the theme you are using from the dropdown menu, for both groups, save all settings, and purge the cache.

    Once saved, you can reload the website on mobile and desktop and you will see the different cache files created for desktop and tablets/mobile in /wp-content/cache/page_enhanced/yoruwebsite/some-page/

    Thanks!

    Thread Starter tanmaymeh

    (@tanmaymeh)

    Hi there, It is not allowing me to select same theme for both groups. It is saying you are selecting duplicate theme. As I already said, I have a single theme and I want to create different cache version for mobile and desktop.
    Currently I have Deshsanchar theme selected only on phone groups but same problem showing desktop and mobile version in both platforms. Is there any other information to provide you so that you can troubleshoot more easily?

    Thank you for your help.

    • This reply was modified 8 months, 1 week ago by tanmaymeh.
    Plugin Contributor Marko Vasiljevic

    (@vmarko)

    Hello @tanmaymeh

    Thank you for your feedback.
    Ah, I got it. SO the reason for this is because the user agents are the same.

    You can simply enable it for phones.

    Thanks!

    Thread Starter tanmaymeh

    (@tanmaymeh)

    Hi there, yes I selected the theme in only the phones group. But it is not working. The problem still exists. Could you please guide me to the right direction to solve it?
    Thank you

    Plugin Contributor Marko Vasiljevic

    (@vmarko)

    Hello @tanmaymeh

    Have you purged the cache? Please make sure to purge all caches including the server side cache and the CDN cache.

    Thanks!

    Thread Starter tanmaymeh

    (@tanmaymeh)

    Hi there, hope you are doing well. Could you please check the settings in below screenshots, what am I missing. The Cache Groups section is not working for me. I cleared all my cache. I am using memcached for caching. I don’t know where I am missing. Please guide me to the right direction. If this generating cache for the mobile version and desktop version works, I would have gone for pro version.

    https://assets.deshsanchar.com/wp-content/uploads/2024/03/29141108/Screenshot-from-2024-03-29-14-10-45.png

    https://assets.deshsanchar.com/wp-content/uploads/2024/03/29141107/Screenshot-from-2024-03-29-14-09-37.png

    https://assets.deshsanchar.com/wp-content/uploads/2024/03/29141105/Screenshot-from-2024-03-29-14-09-32.png

    And another problem that I am facing and I saw this same problem in another support query also. I am getting 100% CPU used by these queries.

    SELECT SQL_CALC_FOUND_ROWS wp_posts.ID
    FROM wp_posts LEFT JOIN wp_postmeta ON ( wp_posts.ID = wp_postmeta.post_id AND wp_postmeta.meta_key = ‘w3tc_imageservice_file’ )
    WHERE 1=1 AND (((wp_posts.post_title LIKE ‘%Russaarmy%’) OR (wp_posts.post_excerpt LIKE ‘%Russaarmy%’) OR (wp_posts.post_content LIKE ‘%Russaarmy%’))) AND (wp_posts.post_mime_type LIKE ‘image/%’) AND (
    wp_postmeta.post_id IS NULL
    ) AND wp_posts.post_type = ‘attachment’ AND ((wp_posts.post_status = ‘inherit’ OR wp_posts.post_status = ‘private’))
    GROUP BY wp_posts.ID
    ORDER BY wp_posts.post_date DESC
    LIMIT 0, 80;

                    SELECT SQL_CALC_FOUND_ROWS wp_posts.ID FROM wp_posts LEFT JOIN wp_postmeta ON ( wp_posts.ID = wp_postmeta.post_id AND wp_postmeta.meta_key = 'w3tc_imageservice_file' ) WHERE 1=1 AND (((wp_posts.post_title LIKE '%bhagawai%') OR (wp_posts.post_excerpt LIKE '%bhagawai%') OR (wp_posts.post_content LIKE '%bhagawai%')) AND ((wp_posts.post_title LIKE '%chau%') OR (wp_posts.post_excerpt LIKE '%chau%') OR (wp_posts.post_content LIKE '%chau%'))) AND (wp_posts.post_mime_type LIKE 'image/%')

    I have enabled lazy loading but disabled webp conversion. How to solve this problem? I am getting this problem frequently. Can It be solved?

    I hope you will help me to solve the problem.

    Thank you so much for your support.

    Best regards,
    Hemant

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘Displaying desktop version nav menu in mobile and vice versa’ is closed to new replies.