PFJA Archives

Technical Details & Archive Architecture: PFJA

This page outlines the technical design, underlying hosting framework, content rendering pipelines, security protocols, metadata schema, and migration strategy for the PFJA Digital Memorial Archive. Built to preserve historical press clippings, journalistic records, and foundational media documentations, the platform prioritizes rapid delivery, multi-lingual font rendering, and long-term archival stability.

1. System Architecture & Current Tech Stack

The digital archive relies on a hybrid architecture combining cloud-backed static page delivery with asynchronous data binding to ensure fast page loads across high-latency networks.

  • Primary Content Engine: Blogger Core Engine with custom XML layout schemas and structured meta-data binding.

  • DNS & Routing: Cloudflare Anycast Network handling SSL/TLS termination, edge caching, and domain security rules.

  • Hosting & CDN Infrastructure: Google Global CDN with distributed edge caching for zero-downtime serving.

  • Typography & Multilingual Engine: Standard web typography integrated with custom font loader modules (including Gulzar font rules for dedicated Urdu archive rendering and custom spacing configs).

2. OCR Text Extraction & Image Compression Specs

To maintain a lightweight footprint while ensuring high legibility and searchability of historical newsprint, all incoming press clippings pass through a dedicated processing pipeline before publication.

2.1 Image Processing & Compression Standards

ParameterSpecificationTarget Objective
Source Capture300 to 1200 DPI (Uncompressed TIFF / PNG / JPG)Ultra-high-density original scan capture for fine microprint & aged newsprint
Output Web FormatWebP (Lossy Compression with Quality Factor 80–85%)$< 250\text{ KB}$ average file size per clipping
Color ProfileGrayscale / Monochromatic optimization for printReduced color depth payload
Responsive AssetsDynamic srcset generating 480w, 800w, and 1200w variantsMobile-first bandwidth optimization
Delivery StrategyNative browser lazy-loading (loading="lazy")Zero blocking on initial DOM paint

Key Technical Considerations for 1200 DPI JPG/PNG/TIFF Imports

  1. Adaptive Resampling: High-density 1200 DPI master scans are downsampled during WebP conversion for web delivery while retaining the original 1200 DPI master files in cold archival storage (e.g., Cloudflare R2 / S3).

  2. Lossy JPG Artifact Cleaning: Incoming JPG press scans undergo artifact reduction filters before OCR processing to remove JPEG block distortion around fine Urdu ligatures and newsprint text.

2.2 OCR Text Extraction & Processing Pipeline

  1. Pre-Processing (Image Cleaning): Raw press scans undergo adaptive thresholding, deskewing ($< 0.5^\circ$ alignment tolerance), and contrast normalization to resolve aged paper discoloration and bleed-through.

  2. Dual-Language Recognition (Urdu & English):

    • English Content: High-precision character recognition targeting standard newsprint serif fonts.

    • Urdu Content: Specialized OCR processing optimized for Nastaliq script structures and historical ligatures.

  3. Structured Text Formatting: Extracted text is mapped to structured HTML/JSON payloads. Urdu text is explicitly tagged with language attributes (lang="ur") to trigger the Gulzar font engine with tailored line-height and letter-spacing parameters.

  4. Search Metadata Injection: Extracted text serves as the indexed body and fallback alt text, ensuring full-text searchability across search engine crawlers and internal site queries.

3. Database Schema & Press Record Metadata

To support standardized cataloging and future platform portability, each historical item in the PFJA repository adheres to a strict JSON document schema. This structure bridges standard Dublin Core metadata elements with press-specific indexing attributes.

3.1 Metadata Attributes Standard

Field NameData TypeRequirementDescription / Standard
record_idString (UUID)RequiredUnique archival identifier (e.g., PFJA-REC-1984-0412)
title_enStringRequiredEnglish title or headline translation
title_urStringOptionalUrdu headline (rendered in Gulzar font)
publication_nameStringRequiredSource publication (e.g., Nawa-i-Waqt, Dawn)
publication_dateString (ISO 8601)RequiredOriginal print date (YYYY-MM-DD)
author_editorArray of StringsOptionalByline journalists, columnists, or editors
language_primaryEnumRequiredPrimary script (ur or en)
page_numberInteger / StringOptionalOriginal newspaper edition page/section
ocr_extracted_textText ObjectRequiredKey-value mapping of raw OCR text by language
media_assetsObject ArrayRequiredCloud CDN URLs, image dimensions, and WebP srcset
tagsArray of StringsRequiredCategorization tags (separated by commas)
permalinkStringRequiredURL slug formatted with hyphens

3.2 Standard JSON Schema Definition

JSON
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "title": "PFJAPressRecord",
  "type": "object",
  "properties": {
    "record_id": { "type": "string" },
    "permalink": { "type": "string" },
    "title_en": { "type": "string" },
    "title_ur": { "type": "string" },
    "publication": {
      "type": "object",
      "properties": {
        "name": { "type": "string" },
        "date": { "type": "string", "format": "date" },
        "edition": { "type": "string" },
        "page": { "type": "string" }
      },
      "required": ["name", "date"]
    },
    "language": {
      "type": "object",
      "properties": {
        "primary": { "type": "string", "enum": ["en", "ur"] },
        "has_dual_text": { "type": "boolean" }
      },
      "required": ["primary"]
    },
    "ocr_content": {
      "type": "object",
      "properties": {
        "text_en": { "type": "string" },
        "text_ur": { "type": "string" },
        "confidence_score": { "type": "number", "minimum": 0, "maximum": 100 }
      }
    },
    "media_assets": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "asset_id": { "type": "string" },
          "webp_url": { "type": "string", "format": "uri" },
          "dpi": { "type": "integer" },
          "width": { "type": "integer" },
          "height": { "type": "integer" }
        },
        "required": ["asset_id", "webp_url"]
      }
    },
    "tags": {
      "type": "array",
      "items": { "type": "string" }
    }
  },
  "required": ["record_id", "permalink", "title_en", "publication", "language", "media_assets", "tags"]
}

4. Technical Migration Roadmap: Blogger to Custom Self-Hosted Framework

To ensure long-term archival autonomy, data ownership, and advanced full-text search capabilities, a phased migration strategy is defined to transition the archive from the legacy Blogger/Cloudflare setup to a dedicated, self-hosted headless architecture (e.g., Next.js / Astro static generator with a Node.js API and PostgreSQL/Document database).

[ Phase 1: Data Extraction & Transformation ] 
                     │
                     ▼
[ Phase 2: Asset Relocation to Cloudflare R2 / S3 ] 
                     │
                     ▼
[ Phase 3: Target Platform & API Deployment ] 
                     │
                     ▼
[ Phase 4: DNS Routing, 301 Redirect Mapping & Cutover ]

4.1 Migration Phases & Execution Timeline

PhaseTechnical ObjectiveKey Deliverables & Tooling
Phase 1: Extraction & ParsingExport raw XML data & extract post bodiesGoogle Takeout XML, custom Python parsing scripts to extract HTML/metadata into JSON schema.
Phase 2: Asset MigrationRelocate media assets from Google CDNAsset scraper downloading WebP files, bulk upload to Cloudflare R2 / S3 object storage with CDN URL rewrites.
Phase 3: Core App EngineBuild headless frontend & API back-endNext.js/Astro SSG framework, PostgreSQL DB with Meilisearch / Elasticsearch for bilingual press text search.
Phase 4: URL & DNS CutoverZero-downtime DNS switch & SEO preservation1:1 permalink mapping table, Cloudflare Page Rules / Workers enforcing 301 permanent redirects.

4.2 Permalink & SEO Mapping Strategy

To preserve search engine rankings and existing inbound links, all legacy Blogger permalinks (/YYYY/MM/post-title.html) will be mapped to clean archival endpoints (/archive/post-title) using Cloudflare Workers edge rules.

  • Legacy URL: [https://pfja.org/2026/05/historical-record-nawa-i-waqt.html](https://pfja.org/2026/05/historical-record-nawa-i-waqt.html)

  • Target Clean Permalink: [https://pfja.org/archive/historical-record-nawa-i-waqt](https://pfja.org/archive/historical-record-nawa-i-waqt)

  • HTTP Redirect Status: 301 Moved Permanently

5. Technical Specifications & Benchmarks

Component / MetricTechnical SpecificationOperational Target
Document DeliveryAsynchronous JSON/XML Payload LoadingFirst Contentful Paint (FCP) $< 1.2\text{ s}$
Bilingual LayoutEnglish & Urdu Dual-Spacing CSS Engine100% Cross-Device Alignment
Archival AssetsHigh-Compression WebP Image ProcessingLightweight Press Clippings
Uptime GuaranteeGoogle CDN + Edge Distributed Routing99.9% High Availability
Transport SecurityTLS 1.3 / HTTPS EnforcedA+ Security Grade

6. Data Processing & Archive Pipeline

[ Historical Newspaper / Press Record Scan ]
                 │
                 ▼
[ Pre-Processing: Deskewing, Contrast & Binarization ]
                 │
                 ▼
[ Dual-Language OCR (Urdu / English Extraction) ]
                 │
                 ▼
[ WebP Image Compression (Responsive srcset) ]
                 │
                 ▼
[ Metadata Structuring & JSON Schema Validation ]
                 │
                 ▼
[ Cloudflare Edge CDN & Edge Routing ]
                 │
                 ▼
[ Asynchronous Client-Side DOM Injection (Gulzar Urdu Engine / English Layout) ]

7. Security, Compliance & Data Preservation

  • HTTPS Enforcement: Universal SSL/TLS encryption shields reader traffic and ensures data integrity.

  • Redundant Backups: Periodic full-site XML automated exports protect the digital repository against data loss.

  • Cache Management: Edge-based cache invalidation rules ensure updated historical records reflect instantly across regions.

  • Robots & Indexing Control: Clean XML sitemaps and structured Schema.org markup optimize record visibility across search engines.