I use Vuejs and I use workbox-webpack-plugin in order to make my site offline, I want to cache a folder which contains all my files (3 files) like picture below, but when I build my project(using Laravel-mix). The main.js (which contains everything of Vue) cannot be cached in service-woker.js. I tried some ways to fix that but those didn't work.
Does anybody face this issue, do you have any solution, many thanks!
Workbox: cannot cache all files when build project
2.6k Views Asked by Duc Trung Mai At
2
There are 2 best solutions below
0
Ritwik Kumar
On
Why are you dealing it manually? Even though you can cache all static asset using
workbox.precaching.precacheAndRoute(self.__precacheManifest || []);
and for dynamic request please use routing with strategy:-
workbox.routing.registerRoute('end point url', workbox.strategies.networkFirst({
cacheName: 'cache-name'
}));
Related Questions in LARAVEL
- Attempting to bind Guzzle Curl Client to Laravel's Service Container -- then Type Hint the Client Fails when attempting to __construct()
- Can not access the 3rd table in laravel 5 in 3 tables have relationships
- No laravel sync folders in homestead vagrant on windows
- How to use where date(timeline) in Laravel Query Builder
- Laravel Eloquent "Many-to-Many-to-One ?"
- Laravel: Locale Session: Controller gets Parameter to change it but it cant. U have to hardcode it
- Stopping an infinite loop process in vagrant
- Insert multiple rows in Laravel
- laravel full-text search with multiple keywords together
- Laravel : Saving a belongsToMany relationship
- Add a Controller to a Laravel 5 Package
- Laravel. Eloquent query for two tables
- Add readonly attribute in form model binding only when editing in laravel 5
- Laravel firstOrNew how to check if it's first or new?
- How to show variable in view blade.php page using laravel paginator::make
Related Questions in CACHING
- ClassCastException: datastructures.instances.JClass cannot be cast to java.util.ArrayList
- Robospice. How to save data and how to get data from DB?
- Make @lru_cache ignore some of the function arguments
- Xib taking long time (>1s) to load. UIFont cache seems to blame
- Android picasso cache images
- Rails 4 low-level caching not working
- How to cache Exchange web service API autodiscoverurl?
- The process cannot access the file because it is being used by another process asp.net
- Alamofire loading from cache even when cache policy set to ReloadIgnoringLocalAndRemoteCacheData
- Java Heap vs Cache
- In what use cases is locking on ASP.NET cache required/desirable
- Chrome cache overriding angularjs disabling of cache
- AFNetworking 2.0 Cache Issue
- Symfony ESI Cache / Surrogate Listener Issue
- Using getOrElseUpdate of TrieMap in Scala
Related Questions in VUE.JS
- jqBootstrapValidation() is not a function
- In Vue.js, change value of specific attribute for all items in a data array
- Vue.js - How to handle all elements with the same selector?
- How can I use Elixir + Vueify?
- Bind function on newly created element
- Vue.js Passing data to content scope
- Updating the DOM with change in an object (vue.js) - binding not working?
- websocket + vuejs: screen flickering, visible mustache code
- Vue.js nested v-repeat: How to access parent $index inside child?
- VueJS - trouble understanding .$set and .$add
- Difference between two similar functions, why is one working and the other not
- Display unescaped HTML in Vue.js
- Mouseover or hover vue.js
- vuejs: Trying to focus the input using v-el directive
- Vue.js component issue
Related Questions in LARAVEL-MIX
- Error (es2015 not found) running "npm run dev" on a laravel homestead
- combining js files in app.js in laravel 5
- How can I compile assets using Laravel Mix?
- Why there exist error when I run npm install --no-bin-links?
- Laravel Mix - Dependency was not found (for custom js file)
- Laravel npm run dev returns TypeError: chunk.sortModules is not a function
- NPM install fails with ETXTBSY error, text file is busy
- Purifying css assets via laravel mix doesnt work
- Bootstrap 4 Navbar Collapsed for Mobile on Page Load (Laravel/laravel-mix)
- How to modify babel-preset-env configuration in laravel-mix
- Laravel Mix not recognising trailing comments eg "/*!".... Vue.js
- Laravel mix .extract method
- Workbox: cannot cache all files when build project
- How to create a svg sprite on Laravel MIX?
- using the mix() helper in a bladeview inside a conditional giving errors
Related Questions in WORKBOX
- Register non-navigation routes in Workbox
- Postprocess page content with staleWhileRevalidate
- Workbox: cannot cache all files when build project
- How to ignore url querystring from cached urls when using workbox?
- Workbox service worker maxAgeSeconds query
- What's the use case for Workbox NetworkOnly strategy
- maximumFileSizeToCacheInBytes make SW redundant
- Use workbox in Jest test
- Workbox advanced recipes example with Gulp
- Why does workbox-webpack-plugin prepend "auto" to all asset paths? (resulting in 404's when the app starts up)
- How to check if there are pending requests in workbox-background-sync?
- How to generate predefined manifest with versioning using workbox-build for Service Worker
- How to help "old \ existing customers" that already have cached index.html as part of service worker without asking them to manually refresh
- Can't read image while trying to configure Workbox offline functionality
- How to manage race condition in a service worker
Trending Questions
- UIImageView Frame Doesn't Reflect Constraints
- Is it possible to use adb commands to click on a view by finding its ID?
- How to create a new web character symbol recognizable by html/javascript?
- Why isn't my CSS3 animation smooth in Google Chrome (but very smooth on other browsers)?
- Heap Gives Page Fault
- Connect ffmpeg to Visual Studio 2008
- Both Object- and ValueAnimator jumps when Duration is set above API LvL 24
- How to avoid default initialization of objects in std::vector?
- second argument of the command line arguments in a format other than char** argv or char* argv[]
- How to improve efficiency of algorithm which generates next lexicographic permutation?
- Navigating to the another actvity app getting crash in android
- How to read the particular message format in android and store in sqlite database?
- Resetting inventory status after order is cancelled
- Efficiently compute powers of X in SSE/AVX
- Insert into an external database using ajax and php : POST 500 (Internal Server Error)
Popular Questions
- How do I undo the most recent local commits in Git?
- How can I remove a specific item from an array in JavaScript?
- How do I delete a Git branch locally and remotely?
- Find all files containing a specific text (string) on Linux?
- How do I revert a Git repository to a previous commit?
- How do I create an HTML button that acts like a link?
- How do I check out a remote Git branch?
- How do I force "git pull" to overwrite local files?
- How do I list all files of a directory?
- How to check whether a string contains a substring in JavaScript?
- How do I redirect to another webpage?
- How can I iterate over rows in a Pandas DataFrame?
- How do I convert a String to an int in Java?
- Does Python have a string 'contains' substring method?
- How do I check if a string contains a specific word?

EDIT: Some time ago, a guy on GitHub helped me figure this out.
It's because there's a Workbox config property called
maximumFileSizeToCacheInBytes. By default it is set to 2MB, which means it will only cache files that are smaller than (or equal to) 2MB. Some of my built files are larger than that. I only needed to increase themaximumFileSizeToCacheInBytesto solve the issue and include those larger files in the generated service worker.My updated Workbox config looks like this: