{'fraction_non_alphanumeric': 0.02346965583676329, 'fraction_numerical': 0.004816533847096943, 'mean_word_length': 4.530266343825666, 'pattern_counts': {'":': 0, '<': 0, '<?xml version=': 0, '>': 0, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
Performance Assessment of Caching Techniques in PWAs

 Abstract: Mobile software development is an emerging technology. The aim of working on this technology is to make it user-friendly and improve the user experience. This paper focuses on the advancing technology - Progressive Web Apps (PWAs). These apps combine the experience of both native and web applications. Progressive web apps are cross-platform developed which means that the app should function both on Android and iOS platform. While web/hybrid/native apps are costly to build, PWAs are way cheaper to build. These apps provide far better user experience than the conventional native/web/hybrid mobile applications. The service worker is the foundation of a PWA. Service Worker enables caching of assets and controls the network traffic. Manifest file lets the app to be installed on the user’s device. Different caching techniques are discussed in the paper and their performance has been monitored. The performance of the Progressive Web App is analyzed using Blazemeter as Remarkable growth has been seen in the performance of several business platforms after the implementation of progressive web apps. This paper assesses: (1). The difference in features of Native/Mobile Web/ Hybrid Web Mobile with PWAs, (2). Performance Analysis of the caching techniques in PWAs.


I. INTRODUCTION
Progressive web apps are software applications that are developed so that the main features of an application can work with or without an internet connection [1]. These apps do not need to be installed either from the Google play store on Android or from the Apple App Store for iOS. Due to its Cross -platform approach, the feature of adding it to the home screen turns out to be very useful. The word "progressive" means that the application is functional even if the user has an unsupported browser. Background sync with the server allows the PWA to function even in the absence of internet connection. They have numerous advantages over native, hybrid and web apps. These apps provide far better user experience than conventional mobile or web applications. Services like push notifications and app like icons increase the activity of the user and help the user to get acquainted with the app in a short period of time. So, these apps act as an envelope that covers both the native applications as well as web applications.

A. Native Applications
These applications are platform-dependent which means that the codes are specifically written for different platforms like Android, iOS etc [2]. One of the challenges faced by these applications is fragmentation. Fragmentation is the event that occurs when some mobile devices use older versions of OS while others use newer versions.
[3]Native apps add on to the local storage of the device and require more time to access with areas having bandwidth 2G and less than that or 3G network. Usually, Java is used to build native apps for Android and Swift or Objective-C for iOS. The cost of building a native app is more than hybrid apps. Native apps must be compatible with their respective operating systems which provide security and device compatibility.

B. Mobile Web Applications
These apps are developed using HTML, CSS and JavaScript and require web browsers to function. These are very similar to the native applications but are executed in a web browser [2]. They look like native apps but really are websites. They occupy less device memory and necessarily require an internet connection for their functionality.
It is not essential to install these apps but can be used on a web browser. Web apps condense the website content to improvise functionality.

C. Web-Based Hybrid Mobile Applications
These apps are partial native and partial web apps. They acquire the attributes of both native and web applications and are more efficient. These are developed using web technology and can be distributed on any mobile platform. The frameworks like Kotlin, React Native etc are used to design these applications support major platforms. The native wrapper is used to collect the best from both native and web apps [5]. Hybrid apps are easier to scale which means that it is easier to launch the app on another platform.

D. Progressive Web Applications (PWAs)
These apps provide user the experience of both a website and a mobile application. It can be installed and has an icon added to the home screen of mobile device. It has two main components which are responsible for its activity, service worker and app manifest file.
Service worker is responsible for caching the pages upon the installation of the app. Manifest file is responsible for executing the features like push notifications. Working in the offline mode outstand them from the native and other web applications. These apps need to be installed once and work even when they lose network connection or slow network. They are available on secure origins served through TLS, using the HTTPS protocol. Table I represents the feature comparison of PWA with Native/Web/Hybrid Applications.

III. MANIFEST FILE
It is referred to as the file which is required so that the application is identified on a mobile device. The information regarding the application is held by the JSON (JavaScript Object Notation) file [5]. This file tells the browser how the application will behave when installed on a device [6]. It also contains the icon of the application to be installed along with splash screen settings. It gives the user a better experience and provides quick access. The user can modify the appearance, theme, and the other regions they expect [7].

IV. SERVICE WORKER
Service Worker is a very important building block of a progressive web app. It is basically a JavaScript file that is executed separately from the main browser thread, caching or retrieving resources from the cache and intercepting network requests. It is responsible for loading the app on multiple devices, controlling push notifications and other assets like handling network traffic. Fig. 2. Shows the working of a Service Worker in the offline mode.

Fig. 2. Working of Service Worker when Offline
Normal Web apps need a stable internet connection to work properly. When network connection fails, these apps fail to work and that's when service worker comes in to picture in case of PWAs [6]. The cached assets are loaded, making them work offline.Service worker adds dynamism to an app and increases its performance by helping to display and dropping the right content and background programs [3].

A. Working of Service Worker
Since most of the groundwork of PWA is done by the service worker, it becomes crucial to check the compatibility of the service worker with the web browser first. An application without a service worker cannot be called an application, it is merely a website. It is a JavaScript file which is executed separately from UI. Service worker is a property of the navigator object of the window. It has to be registered first. Registration can be done on every page load as this process doesn't start from the beginning every time. If service worker is new or updated, the installation process will be initiated. The mechanism of a service worker accommodates three major events:

International Journal of Engineering and Advanced Technology (IJEAT)
ISSN: 2249 -8958, Volume-9 Issue-5, June 2020 1) Install: This is the very first event which is triggered when an app is visited on any device. Its main function is to load the service worker so that the assets of the website can be cached.
2) Activate: This event is triggered to modify (update/remove) the previous data which was cached. This event is the ideal location for removing cached static content if it has a newer version.

3) Fetch:
This event is triggered every time a response is fetched from the server. It is triggered multiple times. Network traffic can be tracked and managed from this event.

B. Types of Caching
Caching techniques that can be employed with the service worker to have an ideal experience are: 1) Precache: The content files and assets are cached all at once when the 'install' event is triggered i.e. while the service worker is being installed. Fig. 3. gives the code to be added in install event.

Fig. 3. Code to be added in install event
The developer has to manually enter the path of all the assets and files which is a tiring and cumbersome task. All the assets are mentioned in the array and are cached by the service worker at once. 2) Dynamic caching: The assets or content files are cached in the "fetch" event. All the assets from the response which are requested by the browser are cached here all at once. Fig. 4. gives the code to be added in fetch event.

Fig. 4. Code to be added in Fetch event
Dynamic caching turns out to be very useful in those cases where there are a lot of assets to be cached and adding path manually is not practically possible.

V. PERFORMANCE ANALYSIS
Since Caching plays a very important role in PWA and different caching techniques have been discussed above, a test was conducted on a 2-page static website using Blazemeter [8] to check performance of website performing different caching techniques. Table II represents the cached assets of the website.   After analyzing the results of the tests performed, it is observed that the response time for PWA turns out to be almost same in both the cases. The response time may change depending on the size of the PWA. Be it precaching or dynamic caching similar graphs are obtained in both the cases. So, it is upto the developer, what approach he wants to use. But dynamic caching is highly recommended as it reduces the pain of adding routes of all the assets manually and is a practically more feasible for larger websites.

VI. CASE STUDY: TWITTER LITE
The mobile website of Twitter had many issues which twitter wanted to overcome. Slow mobile connectivity and limited space on the mobile devices were few of the problems. This ended up in a reduction in the number of visitors on Twitter's website.
Twitter was looking for features such as instant loading, lower data consumption, and large accessibility. Hence, they switched to PWA. 1) The bounce rate reduced from 80% to 20% 2) Rise in pages per session increased to 65% 3) Number of tweets send increased to 75% 4) Reduction in the average loading time.

VII. FUTURE SCOPE
Progressive web apps are the ultimate future of mobile software development. It is a huge upgrade in the responsive web apps. Google uses an acronym-FIRE -Fast, Integrated, Reliable, and Engaging to explain why PWAs are so effective [10]. With the latest browsing technologies coming, these apps combine the accessibility of the web with mobile apps. Currently the features of a progressive web app are supported by various degrees of web browsers like Microsoft Edge, Google Chrome, Mozilla Firefox, Apple Safari but more web browsers may support the features in future.

VIII. CONCLUSION
It is concluded through this paper that Progressive Web Apps are eventually the best technology and the future of web development to improvise the user experience and overcome the problems faced in conventional native web applications. The working of the Service Worker is discussed to improvise the caching process. Performance Analysis has been done on different caching techniques of a PWA, pointing out their advantages and disadvantages.