question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Hello, really nice plugin!

I’m doing a server side render of blog posts and was hoping to cache the server side render as externals, but your documentation says I cannot pattern match externals. What would be the recommended solution here? I’m really trying to avoid having to list each possible blog post path as an external.

    new OfflinePlugin({
      caches: {
        main: [
          '/',
          ':rest:',
        ],
        additional: [
          '/post/*',
        ],
      },
      externals: [ '/', '/post/*' ],
      scope: '/',
      updateStrategy: 'all',
      version: 'v1',
      ServiceWorker: {
        output: 'sw.js',
      },
      AppCache: {
        directory: 'appcache/',
      },
    }),```

Issue Analytics

  • State:open
  • Created 7 years ago
  • Reactions:2
  • Comments:10 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
NekRcommented, Apr 3, 2016

Thinking more about it, it won’t be possible to implement even runtime pattern matching for main and additional cache section since plugin simply do not know what to cache, i.e. it doesn’t what means '/post/*'. To match pattern for assets, we have to do matching agains something, e.g. agains generated assets or URLs requested from page in runtime. Given that, pattern matching at runtime could be implemented only for optional cache section since it’s to cache assets only when they were requested.

0reactions
NekRcommented, Oct 15, 2016

Here is possible API design for it: https://github.com/NekR/offline-plugin/issues/117

Can you take a look? Would you be okay with it?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Caching resources during runtime - Chrome Developers
Learn how to handle caching resources during runtime, including cross-origin resources.
Read more >
System.Runtime.Caching Namespace - Microsoft Learn
ObjectCache Class (System.Runtime.Caching). Represents an object cache and provides the base methods and properties for accessing the object cache.
Read more >
Runtime Caches - SAP Help Portal
Cache refresh is triggered automatically when an object in the ES Repository or in the Integration Directory is activated. In addition to this,...
Read more >
Cache · Cloudflare Workers docs
For instance, Cloudflare Workers runtime exposes a single global cache object. let cache = caches.default;. await cache.match(request);.
Read more >
System.Runtime.Caching 7.0.0 - NuGet
System.Runtime.Caching 7.0.0 ·.NET CLI · Package Manager · PackageReference · Paket CLI · Script & Interactive · Cake.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found