• Resolved laserstore

    (@laserstore)


    Dear dev!
    I read in the pinned thread that it is possible to create a cached version separately and I “understand” the process described, however when I do, I can’t get the result. I still have the same cache loaded. It turns out that due to design and size issues, my theme allows me to create a separate page for mobile devices, which is very interesting.
    So if you access it on mobile first, the mobile cache ends up being loaded for desktop as well.
    I went to GIT and downloaded your code, placed it inside a specific folder in my theme (there was no asset folder in the example). I went to WP-Config and put the line indicated in the plugin’s FAQ. I also enabled Workers mode in the plugin.
    What could I have done wrong? Could it be the path inside the file? On my host the site folder is inside httpdocs, so I tried several paths, starting with /httpdocs/wp-content… or just /wp-content/… but in no case I was able to generate the pages separately. I just need the main page of the site with separate cache, maybe you have some tips.
    thank you very much for your help, your plugin is fantastic!

Viewing 15 replies - 16 through 30 (of 34 total)
  • Thread Starter laserstore

    (@laserstore)

    Hi @isaumya
    Unfortunately it hasn’t worked yet. I left the cached mobile version loaded for desktop viewing in case you want to see it again.
    Thanks again!

    Plugin Contributor iSaumya

    (@isaumya)

    Hi @laserstore,
    Can you confirm that you are using the newly updated worker code? Cause it seems like it is not. And without proper access to your site and CF account to check what’s going on it’s really hard to debug further.

    Thread Starter laserstore

    (@laserstore)

    @isaumya really the code was not updated there. Should I update manually?

    Plugin Contributor iSaumya

    (@isaumya)

    Yes you can update manually. Or you can just update the codein the custom worker file you mentioned in the wp-config

    Thread Starter laserstore

    (@laserstore)

    @isaumya I had updated the file mentioned in wp-config but it didn’t automatically update in workers. So I decided to update manually and click “save and deploy” but even then the problem remains. Do you think I should delete everything and create again?

    Thread Starter laserstore

    (@laserstore)

    And another question. Do I need to create an http route?

    View post on imgur.com

    Plugin Contributor iSaumya

    (@isaumya)

    Hi @laserstore,
    Once you updated the code of the custom worker file mentioned inside the wp-config inside the plugin click on disable page cache and then ebale page cache again. That should auto create the new worker with the HTTP route added to it.

    Also make sure there is no other custom worker or cache everything page rule is present.

    Let me know if you see the new worker get created with the HTTP route added to it once you disable and enable cache. And make sure you updated the custom worker code with the one mention in the updated gist (link given above).

    Thread Starter laserstore

    (@laserstore)

    @isaumya OK. route has been created again, but the code that appears is still the old one. If I put the new code, disable the cache and enable it again, the default code returns, it doesn’t update to the new one. I updated the code inside the .js file and saved and confirmed the change in wp-config is correct, the absolute path is also correct, but it does not update the code.

    View post on imgur.com

    Plugin Contributor iSaumya

    (@isaumya)

    Hi @laserstore,
    It seems the file path is wrong. But anyways for now you can quick edit the worker code inside CF and replace it with the custom worker code. Then try and test.

    Thread Starter laserstore

    (@laserstore)

    @isaumya the way was wrong. It’s not httpsdocs, it’s httpdocs. I fixed it and the file update worked, but the cache didn’t really work properly. Now I’m sure the code is correct in workers.

    Plugin Contributor iSaumya

    (@isaumya)

    Can you share the list of items in the Prevent the following URIs to be cached section?
    Something is super wrong in your site/setup. Cloudflare is not properly working on your site for some reason and I don’t have enough data to tell you why.

    Please double check there is no other page caching system in place be it at the server level or other caching plugin enabled.

    There is also some plugin setting the PHPSESSID cookie in some of your pages. Find that and remove it. https://i.imgur.com/ApT98av.jpeg

    Thread Starter laserstore

    (@laserstore)

    @isaumya The correct link is https://idogyou.com.br . The site https://www.dogvibe.com.br is the site in production, so I can’t make this change on it yet. The idogyou domain is for testing. Dog Vibe does not currently have its plugin active. Only some links are pointing to the other site because it’s a copy.

    Plugin Contributor iSaumya

    (@isaumya)

    From what I am seeing the worker is working perfectly:

    View post on imgur.com

    View post on imgur.com


    Generating separate cache version for mobile and desktop.
    Also for tablet: https://i.imgur.com/0bvaLv5.jpeg

    Please make sure that you do not have any page rules isside the idogyou.com.br CF account related to caching. Also under CF Dashboard > caching > Settings – Browser Cache TTL is set to respect headers.

    Also enable Tiered Cache inside the CF account > caching section.

    Also force Purge everything after making these changes.

    • This reply was modified 2 years, 12 months ago by iSaumya.
    Thread Starter laserstore

    (@laserstore)

    @isaumya
    Yes, everything seems to work fine, but the mobile version loads on the desktop. the desktop version has two columns instead of just one. all settings in the plugin are correct and also in cloudflare. I still see something wrong, I don’t know if the header is correct. See:

    View post on imgur.com

    Thread Starter laserstore

    (@laserstore)

    This is a correct desktop version. On the site in production I’m using wp-rocket and the option to separate the mobile cache is active. You can check the correct operation in it, but even here presenting the headers the page loaded is always the one that enters first after cleaning the cache, that is, if accessed by mobile, this will be the page in cache also for desktop.
    If you access the desktop first, this will be the version saved on mobile as well.

    View post on imgur.com

Viewing 15 replies - 16 through 30 (of 34 total)
  • The topic ‘Mobile Page Separated Cache’ is closed to new replies.