• Resolved Julien ALIBERT

    (@julien-alibert)


    Hi,

    I would want use a category page in place of home page like start url of the PWA.
    Can I do that?

    add_filter( 'web_app_manifest', function( $manifest ) {
        $manifest['start_url'] = 'CustomPostCatPageUrl';
        return $manifest;
    } );

    NB : PWA not working on my website. Looks like a WP Rocket issue, wp.serviceworker is broked. I try to find a solution with them.

    Best regards,

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

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author Weston Ruter

    (@westonruter)

    Yes, that filter code is how you can customize the start_url.

    I can see that WP Rocket is indeed messing up the service worker response:

    1. It’s causing the response to have an text/html content type as opposed to the text/javascript.
    2. It’s adding an HTML comment to the end of the JS response: This website is like a Rocket, isn't it? Performance optimized by WP Rocket. Learn more: https://wp-rocket.me - Debug: cached@1613062286.

    Both of these indicate WP Rocket is failing to see what the original content type was in the response. It should only be caching HTML responses, not JS ones.

    A quick fix would be for you to exclude the /wp.serviceworker URL from WP Rocket. But WP Rocket should not be doing what it is at present.

    Thread Starter Julien ALIBERT

    (@julien-alibert)

    It’s done. Thank you for your prompt response!

    @westonruter I am facing this same issue and was delighted to find your response. I am using WP Rocket for a few weeks now. I know this topic is closed but I find out response helpful.

    @julien-alibert, please can you let me know where you excluded the URL /wp.serviceworker? Would that be in the WP Rocket settings under “Advanced rules”?

    Thank you for your feedback

    Plugin Author Weston Ruter

    (@westonruter)

    @deetee1 I don’t use WP Rocket, but I did find this docs page: https://docs.wp-rocket.me/article/54-exclude-pages-from-the-cache

    Look for the “Never Cache URL(s)” setting I think and add /wp.serviceworker to the list.

    Thread Starter Julien ALIBERT

    (@julien-alibert)

    Is it.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘How to change start_url?’ is closed to new replies.