Skip to content

Commit

Permalink
fix: disable hydration HTTP transfer cache (#1635)
Browse files Browse the repository at this point in the history
The introduction of SSR hydration with the last Angular Upgrade also activated HTTP Cache transfer which is not desired in all cases. The PWA was designed to specifically refetch certain resources when booting up on the client (i.e. CMS and Product Data). HTTP Client Cache is disabled again.
https://angular.io/api/platform-browser/provideClientHydration
  • Loading branch information
dhhyi authored Apr 26, 2024
1 parent 4755c15 commit 0f664eb
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/app/app.module.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { APP_ID, NgModule, TransferState } from '@angular/core';
import { BrowserModule, provideClientHydration } from '@angular/platform-browser';
import { BrowserModule, provideClientHydration, withNoHttpTransferCache } from '@angular/platform-browser';
import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
import { UrlSerializer } from '@angular/router';

Expand Down Expand Up @@ -46,7 +46,7 @@ import { ShellModule } from './shell/shell.module';
providers: [
{ provide: UrlSerializer, useClass: PWAUrlSerializer },
{ provide: APP_ID, useValue: 'intershop-pwa' },
provideClientHydration(),
provideClientHydration(withNoHttpTransferCache()),
],
})
export class AppModule {
Expand Down

0 comments on commit 0f664eb

Please sign in to comment.