Webskyne
Webskyne
LOGIN
← Back to journal

28 May 2026 • 7 min read

Boosting E-Commerce Performance: How Webskyne Reduced Page Load Time by 65% Using Next.js and AWS

Webskyne partnered with a mid-sized e-commerce retailer struggling with slow page loads and high bounce rates. By migrating their storefront to Next.js, leveraging AWS CloudFront for global CDN distribution, and implementing advanced image optimization and server-side rendering strategies, the team achieved a 65% reduction in average page load time. Core Web Vitals scores jumped from failing to exceeding thresholds, organic traffic increased by 22%, and conversion rates rose by 15%. This case study details the technical challenges, architectural decisions, and measurable outcomes of the performance overhaul.

Case StudyPerformance OptimizationNext.jsAWSE-commercePage SpeedCore Web VitalsReactCloud Architecture
Boosting E-Commerce Performance: How Webskyne Reduced Page Load Time by 65% Using Next.js and AWS
# Boosting E-Commerce Performance: How Webskyne Reduced Page Load Time by 65% Using Next.js and AWS ## Overview In early 2026, a growing direct-to-consumer brand approached Webskyne with a pressing problem: despite strong marketing campaigns and a loyal customer base, their online store suffered from sluggish performance. Page load times averaged 5.8 seconds on mobile, well above the 3-second threshold that studies show leads to significant abandonment. Bounce rates hovered near 45%, and the store’s Core Web Vitals—particularly Largest Contentful Paint (LCP) and Cumulative Layout Shift (CLS)—were consistently in the "needs improvement" or "poor" range according to Google’s PageSpeed Insights. The existing stack relied on a traditional PHP-based monolith with a customized Shopify Plus front‑end, hosted on a single regional server. While functional, the architecture lacked modern optimization techniques such as incremental static regeneration, edge caching, and automatic image format selection. The client’s goals were clear: cut load time in half, improve search visibility, and create a scalable foundation for future feature development without disrupting ongoing sales. Webskyne proposed a performance‑first rebuild using Next.js 13 with the App Router, React 18, and a suite of AWS services including CloudFront, S3, Lambda@Edge, and DynamoDB for session storage. By adopting a Jamstack‑inspired approach while retaining server‑side rendering for personalized content, the team aimed to deliver fast, secure, and globally available experiences. Over a 12‑week engagement, Webskyne migrated product catalog pages, collection grids, and the checkout flow to the new platform. The result was a 65% reduction in average page load time (from 5.8 s to 2.0 s), LCP dropping from 4.9 s to 1.8 s, and CLS improving from 0.12 to under 0.01. Organic search traffic rose 22% within six weeks, and conversion rates increased by 15%, translating to a measurable revenue uplift. ## Challenge The legacy storefront faced several interconnected performance bottlenecks: 1. **Server‑Side Rendering Overhead**: Every request hit a PHP‑FPM process that rendered HTML server‑side, queried a MySQL database for product data, and applied multiple layers of theme hooks and plugins. This process added 1.2–1.8 seconds of pure server latency even before network transfer began. 2. **Unoptimized Asset Delivery**: Images were served at original resolutions (often 2000+ px wide) regardless of device screen size, and no modern formats like WebP or AVIF were used. JavaScript and CSS bundles were monolithic, containing code for features not used on the current page. 3. **Lack of Edge Caching**: The single‑region hosting meant that users far from the server experienced high TCP handshake and TLS negotiation times. Static assets were not cached at the edge, forcing each visitor to download the same resources from the origin. 4. **Render‑Blocking JavaScript**: Theme scripts and third‑party widgets (chat, reviews, analytics) loaded synchronously in the document head, delaying the first paint. 5. **Layout Instability**: Dynamic injection of banners and promo bars caused frequent layout shifts, hurting CLS scores. 6. **Limited Scalability**: During flash sales, the monolith struggled to scale horizontally, leading to occasional 502 errors and slowed response times. These issues combined to produce a poor user experience, especially on mobile networks, and negatively impacted SEO rankings because Google penalizes slow‑loading pages. ## Goals Webskyne and the client defined the following measurable objectives for the performance overhaul: - **Reduce average page load time** (as measured by Web Vitals in Chrome UX Report) from 5.8 seconds to under 2.5 seconds—a reduction of at least 55%. - **Achieve "Good" Core Web Vitals** across LCP (<2.5 s), FID (<100 ms), and CLS (<0.1) for at least 75% of page views. - **Increase organic search traffic** by 20% within three months of launch, attributing gains to improved page experience signals. - **Boost conversion rate** (completed purchases per session) by 10% relative to the baseline. - **Maintain or improve** existing functionality, including personalized recommendations, cart persistence, and third‑party integrations (email marketing, analytics, live chat). - **Ensure scalability** to handle traffic spikes of up to 10× average load during promotional events without manual intervention. - **Reduce operational overhead** by moving to a managed, serverless‑friendly architecture that minimizes patching and scaling concerns. ## Approach Webskyne adopted a performance‑centric redesign guided by the RAIL model (Response, Animation, Idle, Load) and the Core Web Vitals framework. The plan unfolded in five phases: 1. **Audit and Baseline**: Using Lighthouse, WebPageTest, and real‑user monitoring (RUM) via Google Analytics, the team captured detailed performance metrics for each template type (home, product, collection, cart, checkout). This baseline informed prioritization. 2. **Architectural Design**: The new stack combined Next.js 13 (App Router) for hybrid rendering, AWS S3 for immutable asset storage, CloudFront for global CDN distribution, Lambda@Edge for request‑level rewrites and header injection, and DynamoDB for session storage. A GraphQL layer (hosted on AWS AppSync) aggregated product data from the existing ERP via REST endpoints, allowing the frontend to fetch only needed fields. 3. **Incremental Migration**: Rather than a big‑bang rewrite, Webskyne migrated templates one by one, starting with high‑traffic pages (homepage and top‑selling product pages). Each migrated page lived alongside the legacy version behind a feature flag, enabling A/B testing of performance and user behavior. 4. **Optimization Implementation**: Key techniques included: - Automatic image optimization via Next.js Image component with responsive sizes, modern formats (WebP/AVIF), and priority props for above‑the‑fold images. - Static generation (SSG) for product listings and collection pages, revalidated incrementally (ISR) every 5 minutes. - Server‑side rendering (SSR) for personalized cart and checkout pages, with caching strategies for user‑specific data. - JavaScript and CSS code splitting at the route level, eliminating unused payloads. - Critical CSS extraction and inline injection for above‑the‑fold content. - Lazy‑loading of offscreen images and third‑party embeds. - Use of `rel=preconnect` and `rel=preload` for fonts and critical third‑party scripts. - Edge‑side caching of API responses via Lambda@Edge, reducing origin fetches. 5. **Testing, Monitoring, and Rollout**: Performance budgets were enforced via automated Lighthouse CI in pull requests. Real‑user monitoring continued post‑launch to validate improvements. After a two‑week parallel run, the legacy frontend was decommissioned. ## Implementation ### Frontend Framework The team chose Next.js 13 with the App Router to leverage React 18’s concurrent features and streamlined data fetching. Pages were organized as follows: - **app/** directory containing route‑specific layouts, loading states, and error boundaries. - **components/** for reusable UI elements (buttons, cards, modals). - **lib/** for utility functions, GraphQL client initialization, and image transformation helpers. ### Data Layer Product data remained in the client’s ERP system. Webskyne built a thin GraphQL wrapper on AWS AppSync that: - Exposed queries for `products`, `collections`, `categories`, and `reviews`. - Applied response caching (TTL 2 minutes) to reduce ERP load. - Integrated with Amazon Cognito for user authentication, enabling personalized pricing and wishlist features. ### Asset Optimization All images were uploaded to an S3 bucket. The Next.js Image component was configured with a custom loader that signed URLs via CloudFront key pairs, ensuring secure, cached delivery. Image widths were generated automatically for breakpoints 640, 768, 1024, 1280, and 1920 px, with quality set to 80 for WebP and 85 for AVIF. ### Caching Strategy - **Static Pages**: ISR with revalidation intervals of 5 minutes for collection pages and 60 minutes for blog‑style content. - **User‑Specific Pages**: SSR with `stale‑while‑revalidate` headers (stale 30 seconds, revalidate 60 seconds) served via CloudFront, allowing edge caching of the shell while fetching fresh user data from DynamoDB. - **API Responses**: Lambda@Edge intercepted GraphQL responses, added `Cache-Control: public, max‑age=120`, and stored them in CloudFront’s edge cache for two minutes. ### Code Splitting and Bundle Optimization Using Next.js’s automatic route‑based splitting, each page downloaded only the JavaScript necessary for its initial render. Dynamic `import()` was used for non‑critical widgets (e.g., live chat, product reviews), loading them on interaction. The total initial bundle size dropped from 1.2 MB (legacy) to 280 KB (gzipped). ### Third‑Party Scripts To mitigate render‑blocking, third‑party scripts were loaded via `