Urgent.News

What's breaking now, across thousands of outlets.

Tech

How I Made PdfWord Work Fully Offline as a PWA

Series: Building PdfWord — a free, no-backend PDF tools site (Part 10) Most "free PDF tools" die the moment your Wi-Fi does. That's weird when you think about it — the actual work (merging, compressing, converting) happens on your CPU, not on their server. So when I built PdfWord with zero backend — every tool is static HTML + JavaScript running entirely in your browser — making it work fully…

Building PdfWord as a free, no-backend PDF tools site, it became evident that making it work completely offline was not an afterthought but an inherent aspect of its architecture. The tools perform their functions on the user's CPU, not on remote servers, making full offline functionality a natural outcome of the design.

This project consisted of two main components: a manifest.json (defining the app's appearance and behavior) and a service worker (a script intercepting network requests to serve cached files). With no server to connect to, the service worker simply needed to make offline files accessible. The manifest was designed to enhance user experience, including adding app shortcuts and a share target.

During the development process, a significant mistake was made in the precaching strategy. Initially, the service worker attempted to precache all libraries, leading to excessively slow loading times on low-end devices. To remedy this, the strategy was changed to precache only the essential app shell (~120KB), dynamically downloading and caching heavy libraries (like SheetJS) only upon their first use. This approach ensures users only download necessary resources, improving performance and user experience.

The cache strategy implemented two rules: a network-first approach for HTML pages, serving fresh content, and a cache-first approach for static assets (JavaScript and CSS), which are rarely changed. This approach ensures that stale pages are avoided while static assets are served quickly and reliably. Additionally, a version-bump discipline was established – any change in the service worker file necessitates a version update in the source sw.js, which is then copied to the exact staged path for verification and deployment.

This meticulous process prevents the serving of stale files, ensuring the app always serves the latest version.

A key limitation of this approach is that the first visit requires internet access, as the offline files must initially be downloaded. Furthermore, on iOS, the app installation requires users to add the site to their home screen rather than through a traditional store. Despite these limitations, the benefits are significant: users can perform tasks like merging PDFs in airplane mode, with no server involvement.

The demonstration of this concept is straightforward: install PdfWord on your home screen, enable airplane mode, and merge PDFs. This not only showcases the offline capabilities but also highlights the complete elimination of server dependence, making the tool robust and reliable in any network environment.

Written by urgent.news from Dev.to's reporting — not their text. Machine-written — may contain errors; check the original before relying on it.

Read the original at dev.to →

More in Tech

How to Fix PSR-4 Autoloading Issues in Laravel

When working on a Laravel project, you may encounter warnings when running composer dump-autoload . These warnings often indicate that your model or controller filenames do not match their namespaces…

Four executable counterexamples from a component review repository

Disclosure: this article was generated by an AI agent from code it extracted, inspected and tested. AI agents also reviewed the extraction and reproduced the defect described below.

  • Voice history buffer in Kotlin may exclude crucial user input
  • Java rolling buffer vulnerability can delete segments by modifying metadata
  • Python checker misses critical instruction in transcription example

Building a Product Is Only Half the Job. Getting It Seen Is a Different Problem.

I created a simple experiment around this one question: what would happen if a product’s visibility was made 100% transparent? This is what I do, I spend a lot of my time writing software.

  • Building a product is only half the job; getting it seen is a different challenge.
  • Get-Seen experiment focuses ranking solely on payment amount to make decision transparent.

PDF to Excel in the Browser: Extracting Tables with JavaScript

Series: Building PdfWord — a free, no-backend PDF tools site (Part 11) "Convert my bank statement PDF to Excel" — one of the most requested features I've gotten, and one of the most technically…

  • JavaScript extracts positioned text from PDFs using page.getTextContent() method
  • GroupLines() algorithm reconstructs lines by sorting fragments by y-coordinate and x-coordinate
  • SheetJS converts lines to spreadsheet format for Excel file export

Conflicting Android beta reports: separating observations from verified bugs

Two reports from a small Android beta described different behaviour for the same breathing timer: one tester said it restarted after switching apps, while another said it resumed correctly.

  • Breathing timer restarts after app switch on Android 15 beta.
  • Money-saved widget value matches only after manual refresh.
  • Follow-up test plan proposed to investigate issues.

More from Saturday 10 October →