Skip to content

Commit f11ccd8

Browse files
Bug fix/api view cache (#9158)
* Revert Icon Url Change * Version Service Worker Cache
1 parent 77ed11b commit f11ccd8

2 files changed

Lines changed: 74 additions & 80 deletions

File tree

src/dotnet/APIView/APIViewWeb/Client/css/shared/language-customizations.scss

Lines changed: 54 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -8,230 +8,230 @@
88

99
.java-variant {
1010
&.icon-assembly {
11-
background: url(~@wwwroot/icons/java/common/assembly.svg) center left no-repeat !important;
11+
background: url(/icons/java/common/assembly.svg) center left no-repeat !important;
1212
}
1313

1414
&.icon-gradle {
15-
background: url(~@wwwroot/icons/java/common/gradle.svg) center left no-repeat !important;
15+
background: url(/icons/java/common/gradle.svg) center left no-repeat !important;
1616
}
1717

1818
&.icon-maven {
19-
background: url(~@wwwroot/icons/java/common/maven.svg) center left no-repeat !important;
19+
background: url(/icons/java/common/maven.svg) center left no-repeat !important;
2020
}
2121

2222
&.icon-namespace {
23-
background: url(~@wwwroot/icons/java/common/namespace.svg) center left no-repeat !important;
23+
background: url(/icons/java/common/namespace.svg) center left no-repeat !important;
2424
}
2525

2626
&.icon-spring {
27-
background: url(~@wwwroot/icons/java/common/spring.svg) center left no-repeat !important;
27+
background: url(/icons/java/common/spring.svg) center left no-repeat !important;
2828
}
2929

3030
&.icon-unknown {
31-
background: url(~@wwwroot/icons/java/common/unknown.svg) center left no-repeat !important;
31+
background: url(/icons/java/common/unknown.svg) center left no-repeat !important;
3232
}
3333

3434
&.icon-android {
35-
background: url(~@wwwroot/icons/java/common/android.svg) center left no-repeat !important;
35+
background: url(/icons/java/common/android.svg) center left no-repeat !important;
3636
}
3737

3838
&.icon-annotation {
39-
background: url(~@wwwroot/icons/java/java/annotation.svg) center left no-repeat !important;
39+
background: url(/icons/java/java/annotation.svg) center left no-repeat !important;
4040
}
4141

4242
&.icon-class {
43-
background: url(~@wwwroot/icons/java/java/class.svg) center left no-repeat !important;
43+
background: url(/icons/java/java/class.svg) center left no-repeat !important;
4444
}
4545

4646
&.icon-enum {
47-
background: url(~@wwwroot/icons/java/java/enum.svg) center left no-repeat !important;
47+
background: url(/icons/java/java/enum.svg) center left no-repeat !important;
4848
}
4949

5050
&.icon-interface {
51-
background: url(~@wwwroot/icons/java/java/interface.svg) center left no-repeat !important;
51+
background: url(/icons/java/java/interface.svg) center left no-repeat !important;
5252
}
5353

5454
&.icon-module {
55-
background: url(~@wwwroot/icons/java/common/module.svg) center left no-repeat !important;
55+
background: url(/icons/java/common/module.svg) center left no-repeat !important;
5656
}
5757
}
5858

5959
.kotlin-variant {
6060
&.icon-assembly {
61-
background: url(~@wwwroot/icons/java/common/assembly.svg) center left no-repeat !important;
61+
background: url(/icons/java/common/assembly.svg) center left no-repeat !important;
6262
}
6363

6464
&.icon-gradle {
65-
background: url(~@wwwroot/icons/java/common/gradle.svg) center left no-repeat !important;
65+
background: url(/icons/java/common/gradle.svg) center left no-repeat !important;
6666
}
6767

6868
&.icon-maven {
69-
background: url(~@wwwroot/icons/java/common/maven.svg) center left no-repeat !important;
69+
background: url(/icons/java/common/maven.svg) center left no-repeat !important;
7070
}
7171

7272
&.icon-namespace {
73-
background: url(~@wwwroot/icons/java/common/namespace.svg) center left no-repeat !important;
73+
background: url(/icons/java/common/namespace.svg) center left no-repeat !important;
7474
}
7575

7676
&.icon-spring {
77-
background: url(~@wwwroot/icons/java/common/spring.svg) center left no-repeat !important;
77+
background: url(/icons/java/common/spring.svg) center left no-repeat !important;
7878
}
7979

8080
&.icon-unknown {
81-
background: url(~@wwwroot/icons/java/common/unknown.svg) center left no-repeat !important;
81+
background: url(/icons/java/common/unknown.svg) center left no-repeat !important;
8282
}
8383

8484
&.icon-android {
85-
background: url(~@wwwroot/icons/java/common/android.svg) center left no-repeat !important;
85+
background: url(/icons/java/common/android.svg) center left no-repeat !important;
8686
}
8787

8888
&.icon-annotation {
89-
background: url(~@wwwroot/icons/java/kotlin/annotation.svg) center left no-repeat !important;
89+
background: url(/icons/java/kotlin/annotation.svg) center left no-repeat !important;
9090
}
9191

9292
&.icon-class {
93-
background: url(~@wwwroot/icons/java/kotlin/class.svg) center left no-repeat !important;
93+
background: url(/icons/java/kotlin/class.svg) center left no-repeat !important;
9494
}
9595

9696
&.icon-enum {
97-
background: url(~@wwwroot/icons/java/kotlin/enum.svg) center left no-repeat !important;
97+
background: url(/icons/java/kotlin/enum.svg) center left no-repeat !important;
9898
}
9999

100100
&.icon-interface {
101-
background: url(~@wwwroot/icons/java/kotlin/interface.svg) center left no-repeat !important;
101+
background: url(/icons/java/kotlin/interface.svg) center left no-repeat !important;
102102
}
103103

104104
&.icon-function {
105-
background: url(~@wwwroot/icons/java/kotlin/function.svg) center left no-repeat !important;
105+
background: url(/icons/java/kotlin/function.svg) center left no-repeat !important;
106106
}
107107

108108
&.icon-kotlinLanguage {
109-
background: url(~@wwwroot/icons/java/kotlin/kotlinLanguage.svg) center left no-repeat !important;
109+
background: url(/icons/java/kotlin/kotlinLanguage.svg) center left no-repeat !important;
110110
}
111111

112112
&.icon-object {
113-
background: url(~@wwwroot/icons/java/kotlin/object.svg) center left no-repeat !important;
113+
background: url(/icons/java/kotlin/object.svg) center left no-repeat !important;
114114
}
115115

116116
&.icon-property {
117-
background: url(~@wwwroot/icons/java/kotlin/property.svg) center left no-repeat !important;
117+
background: url(/icons/java/kotlin/property.svg) center left no-repeat !important;
118118
}
119119

120120
&.icon-module {
121-
background: url(~@wwwroot/icons/java/common/module.svg) center left no-repeat !important;
121+
background: url(/icons/java/common/module.svg) center left no-repeat !important;
122122
}
123123
}
124124

125125
.c-variant, .cplusplus-variant, .csharp-variant, .go-variant, .javascript-variant, .json-variant, .python-variant, .swagger-variant, .swift-variant, .xml-variant {
126126
&.icon-class {
127-
background: url(~@wwwroot/icons/class.png) center left no-repeat;
127+
background: url(/icons/class.png) center left no-repeat;
128128
}
129129

130130
&.icon-interface {
131-
background: url(~@wwwroot/icons/interface.png) center left no-repeat;
131+
background: url(/icons/interface.png) center left no-repeat;
132132
}
133133

134134
&.icon-struct {
135-
background: url(~@wwwroot/icons/struct.png) center left no-repeat;
135+
background: url(/icons/struct.png) center left no-repeat;
136136
}
137137

138138
&.icon-enum {
139-
background: url(~@wwwroot/icons/enum.png) center left no-repeat;
139+
background: url(/icons/enum.png) center left no-repeat;
140140
}
141141

142142
&.icon-delegate {
143-
background: url(~@wwwroot/icons/delegate.png) center left no-repeat;
143+
background: url(/icons/delegate.png) center left no-repeat;
144144
}
145145

146146
&.icon-unknown {
147-
background: url(~@wwwroot/icons/type.png) center left no-repeat;
147+
background: url(/icons/type.png) center left no-repeat;
148148
}
149149

150150
&.icon-assembly {
151-
background: url(~@wwwroot/icons/assembly.png) center left no-repeat;
151+
background: url(/icons/assembly.png) center left no-repeat;
152152
}
153153

154154
&.icon-namespace {
155-
background: url(~@wwwroot/icons/namespace.png) center left no-repeat;
155+
background: url(/icons/namespace.png) center left no-repeat;
156156
}
157157

158158
&.icon-package {
159-
background: url(~@wwwroot/icons/package.png) center left no-repeat;
159+
background: url(/icons/package.png) center left no-repeat;
160160
}
161161

162162
&.icon-method {
163-
background: url(~@wwwroot/icons/method.png) center left no-repeat;
163+
background: url(/icons/method.png) center left no-repeat;
164164
}
165165
}
166166

167167
.icon-csharp {
168168
@extend .icon-language;
169-
background: url(~@wwwroot/icons/csharp-original.svg) center no-repeat;
169+
background: url(/icons/csharp-original.svg) center no-repeat;
170170
}
171171

172172
.icon-javascript {
173173
@extend .icon-language;
174-
background: url(~@wwwroot/icons/javascript-original.svg) center no-repeat;
174+
background: url(/icons/javascript-original.svg) center no-repeat;
175175
}
176176

177177
.icon-python {
178178
@extend .icon-language;
179-
background: url(~@wwwroot/icons/python-original.svg) center no-repeat;
179+
background: url(/icons/python-original.svg) center no-repeat;
180180
}
181181

182182
.icon-c {
183183
@extend .icon-language;
184-
background: url(~@wwwroot/icons/c-original.svg) center no-repeat;
184+
background: url(/icons/c-original.svg) center no-repeat;
185185
}
186186

187187
.icon-cplusplus {
188188
@extend .icon-language;
189-
background: url(~@wwwroot/icons/cplusplus-original.svg) center no-repeat;
189+
background: url(/icons/cplusplus-original.svg) center no-repeat;
190190
}
191191

192192
.icon-go {
193193
@extend .icon-language;
194-
background: url(~@wwwroot/icons/go-original.svg) center no-repeat;
194+
background: url(/icons/go-original.svg) center no-repeat;
195195
}
196196

197197
.icon-java {
198198
@extend .icon-language;
199-
background: url(~@wwwroot/icons/java-original.svg) center no-repeat;
199+
background: url(/icons/java-original.svg) center no-repeat;
200200
}
201201

202202
.icon-java-spring {
203203
@extend .icon-language;
204-
background: url(~@wwwroot/icons/java-spring-original.svg) center no-repeat;
204+
background: url(/icons/java-spring-original.svg) center no-repeat;
205205
}
206206

207207
.icon-java-android {
208208
@extend .icon-language;
209-
background: url(~@wwwroot/icons/java-android-original.svg) center no-repeat;
209+
background: url(/icons/java-android-original.svg) center no-repeat;
210210
}
211211

212212
.icon-swift {
213213
@extend .icon-language;
214-
background: url(~@wwwroot/icons/swift-original.svg) center no-repeat;
214+
background: url(/icons/swift-original.svg) center no-repeat;
215215
}
216216

217217
.icon-kotlin {
218218
@extend .icon-language;
219-
background: url(~@wwwroot/icons/kotlin-original.svg) center no-repeat;
219+
background: url(/icons/kotlin-original.svg) center no-repeat;
220220
}
221221

222222
.icon-json {
223223
@extend .icon-language;
224-
background: url(~@wwwroot/icons/json-original.svg) center no-repeat;
224+
background: url(/icons/json-original.svg) center no-repeat;
225225
}
226226

227227
.icon-swagger {
228228
@extend .icon-language;
229-
background: url(~@wwwroot/icons/swagger-original.svg) center no-repeat;
229+
background: url(/icons/swagger-original.svg) center no-repeat;
230230
}
231231

232232
.icon-typespec {
233233
@extend .icon-language;
234-
background: url(~@wwwroot/icons/typespec-original.svg) center center no-repeat;
234+
background: url(/icons/typespec-original.svg) center center no-repeat;
235235
}
236236

237237
.icon-comments {
@@ -242,9 +242,9 @@
242242
}
243243

244244
.icon-chevron-right {
245-
background: url(~@wwwroot/icons/chevron-right.svg) center no-repeat;
245+
background: url(/icons/chevron-right.svg) center no-repeat;
246246
}
247247

248248
.icon-chevron-up {
249-
background: url(~@wwwroot/icons/chevron-up.svg) center no-repeat;
249+
background: url(/icons/chevron-up.svg) center no-repeat;
250250
}
Lines changed: 20 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,21 @@
1+
const version = process.env.BUILD_BUILDID || 'dev';
2+
const globPatterns = [
3+
'favicon.ico',
4+
'index.html',
5+
'manifest.webmanifest',
6+
'*.css',
7+
'*.js',
8+
'assets/**/*.{svg,cur,jpg,jpeg,png,apng,webp,avif,gif,otf,ttf,woff,woff2,json}'
9+
];
10+
111
module.exports = {
2-
globDirectory: '../APIViewWeb/wwwroot/spa',
3-
globPatterns: [
4-
'favicon.ico',
5-
'index.html',
6-
'manifest.webmanifest',
7-
'*.css',
8-
'*.js',
9-
'assets/**/*.{svg,cur,jpg,jpeg,png,apng,webp,avif,gif,otf,ttf,woff,woff2,json}'
10-
],
11-
swDest: '../APIViewWeb/wwwroot/spa/sw.js',
12-
runtimeCaching: [
13-
{
14-
urlPattern: "https://apiviewstagingtest.com/api/reviews/*/content**",
15-
handler: 'CacheFirst',
16-
options: {
17-
cacheName: 'revisioncontent',
18-
expiration: {
19-
maxEntries: 50,
20-
maxAgeSeconds: 24 * 60 * 60, // 1 day
21-
},
22-
},
23-
}
24-
],
25-
skipWaiting: true,
26-
clientsClaim: true,
27-
};
12+
globDirectory: '../APIViewWeb/wwwroot/spa',
13+
globPatterns: globPatterns,
14+
swDest: '../APIViewWeb/wwwroot/spa/sw.js',
15+
skipWaiting: true,
16+
clientsClaim: true,
17+
cleanupOutdatedCaches: true,
18+
modifyURLPrefix: {
19+
'': `?v=${version}`
20+
}
21+
};

0 commit comments

Comments
 (0)