Title: Cache issues
Last modified: February 9, 2021

---

# Cache issues

 *  Resolved [asafm7](https://wordpress.org/support/users/asafm7/)
 * (@asafm7)
 * [5 years, 3 months ago](https://wordpress.org/support/topic/cache-issues-14/)
 * Hi,
 * The plugin seems to cache (using service workers) in the 3 following problematic
   cases:
 * 1. Front-end pages, while logged-in as admin (meaning, when viewing the site 
   as an admin, with the black bar on top)
    2. 307 redirects 3. Pages excluded from
   caching using my cache plugin (LiteSpeed Cache)
 * All of these are excluded from caching by my cache plugin (LiteSpeed Cache), 
   and they are all solved if checking: DevTools -> Application -> Service Workers-
   > Bypass for network
 * To check 2 and 3, you can go to my site, and click “Shuffle” to the right (below
   the title “Filters”). Every click is supposed to bring a new set of hobbies. 
   You can check the network tab in DevTools to see the sequence.
 * [https://simply-hobbies.com/](https://simply-hobbies.com/)
 * What are the possible solutions?
 * Thanks,
    Asaf

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

 *  Plugin Author [Weston Ruter](https://wordpress.org/support/users/westonruter/)
 * (@westonruter)
 * [5 years, 3 months ago](https://wordpress.org/support/topic/cache-issues-14/#post-14026886)
 * > 1. Front-end pages, while logged-in as admin (meaning, when viewing the site
   > as an admin, with the black bar on top)
 * For that see:
 * [https://github.com/GoogleChromeLabs/pwa-wp/issues/252](https://github.com/GoogleChromeLabs/pwa-wp/issues/252)
   
   [https://github.com/GoogleChromeLabs/pwa-wp/issues/363#issuecomment-743571066](https://github.com/GoogleChromeLabs/pwa-wp/issues/363#issuecomment-743571066)
 * > To check 2 and 3, you can go to my site, and click “Shuffle” to the right (
   > below the title “Filters”). Every click is supposed to bring a new set of hobbies.
   > You can check the network tab in DevTools to see the sequence.
 * This is strange, because you’re using the NetworkFirst strategy and this is only
   supposed to cache a 200 status code, not 307: [https://developers.google.com/web/tools/workbox/reference-docs/latest/module-workbox-strategies.NetworkFirst](https://developers.google.com/web/tools/workbox/reference-docs/latest/module-workbox-strategies.NetworkFirst)
 * > 3. Pages excluded from caching using my cache plugin (LiteSpeed Cache)
 * Server-side caching is independent of client-side caching with the service worker.
 *  Plugin Author [Weston Ruter](https://wordpress.org/support/users/westonruter/)
 * (@westonruter)
 * [5 years, 3 months ago](https://wordpress.org/support/topic/cache-issues-14/#post-14027129)
 * Thanks to Jeff Posnick from the Workbox team for pointing this out to me: the
   reason the old responses are being served is because the server is taking longer
   than 2 seconds, as you even show with a tooltip:
 * ![](https://i0.wp.com/cldup.com/Z1tLDq7leZ.png?ssl=1)
 * By default the plugin is configured to serve the cached response if it takes 
   longer than 2 seconds. This is to help ensure that the user experience falls 
   within the “GOOD” range for [Largest Contentful Paint](https://web.dev/optimize-lcp/)(
   LCP) from the Core Web Vitals (CWV).
 * You can override this with a filter, like the following PHP plugin code which
   increases the timeout to 10 seconds:
 *     ```
       add_filter( 'wp_service_worker_navigation_caching', function ( $config ) {
       	$config['network_timeout_seconds'] = 10;
       	return $config;
       } );
       ```
   
    -  This reply was modified 5 years, 3 months ago by [Weston Ruter](https://wordpress.org/support/users/westonruter/).
    -  This reply was modified 5 years, 3 months ago by [Weston Ruter](https://wordpress.org/support/users/westonruter/).
 *  Thread Starter [asafm7](https://wordpress.org/support/users/asafm7/)
 * (@asafm7)
 * [5 years, 3 months ago](https://wordpress.org/support/topic/cache-issues-14/#post-14031776)
 * It seems to solve the issue.
 * Thanks [@westonruter](https://wordpress.org/support/users/westonruter/)

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

The topic ‘Cache issues’ is closed to new replies.

 * ![](https://ps.w.org/pwa/assets/icon.svg?rev=1908485)
 * [PWA](https://wordpress.org/plugins/pwa/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/pwa/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/pwa/)
 * [Active Topics](https://wordpress.org/support/plugin/pwa/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/pwa/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/pwa/reviews/)

 * 3 replies
 * 2 participants
 * Last reply from: [asafm7](https://wordpress.org/support/users/asafm7/)
 * Last activity: [5 years, 3 months ago](https://wordpress.org/support/topic/cache-issues-14/#post-14031776)
 * Status: resolved