René's URL Explorer Experiment


Title: Support caching opaque responses with freshness strategy in ngsw-config.json [PWA][SW] · Issue #30968 · angular/angular · GitHub

Open Graph Title: Support caching opaque responses with freshness strategy in ngsw-config.json [PWA][SW] · Issue #30968 · angular/angular

X Title: Support caching opaque responses with freshness strategy in ngsw-config.json [PWA][SW] · Issue #30968 · angular/angular

Description: Caching opaque responses with freshness strategy in ngsw-config.json [PWA][SW] Relevant Package This feature request is for @angular/pwa. Description The SW might have an option to cache opaque responses in the freshness mode since these...

Open Graph Description: Caching opaque responses with freshness strategy in ngsw-config.json [PWA][SW] Relevant Package This feature request is for @angular/pwa. Description The SW might have an option to cache opaque res...

X Description: Caching opaque responses with freshness strategy in ngsw-config.json [PWA][SW] Relevant Package This feature request is for @angular/pwa. Description The SW might have an option to cache opaque res...

Opengraph URL: https://github.com/angular/angular/issues/30968

X: @github

direct link

Domain: github.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Support caching opaque responses with freshness strategy in ngsw-config.json [PWA][SW]","articleBody":"# Caching opaque responses with freshness strategy in ngsw-config.json [PWA][SW]\r\n\r\n### Relevant Package\r\nThis feature request is for @angular/pwa.\r\n\r\n\r\n### Description\r\nThe SW might have an option to cache opaque responses in the freshness mode since these caches are short-lived and therefore having an inadequate response would be quickly updated/removed.\r\n\r\nI was reading ngsw-worker.js's code and now I have one question.\r\nIn the next function, what is the purpose of `okToCacheOpaque`? Is it to avoid having the opaque answers cached or just to the opposite? What is the real usage of this variable now?\r\nCould this variable be used to cache opaque responses?\r\n\r\n```javascript\r\n/**\r\n         * Operation for caching the response from the server. This has to happen all\r\n         * at once, so that the cache and LRU tracking remain in sync. If the network request\r\n         * completes before the timeout, this logic will be run inline with the response flow.\r\n         * If the request times out on the server, an error will be returned but the real network\r\n         * request will still be running in the background, to be cached when it completes.\r\n         */\r\n        cacheResponse(req, res, lru, okToCacheOpaque = false) {\r\n            return __awaiter$1(this, void 0, void 0, function* () {\r\n                // Only cache successful responses.\r\n                if (!res.ok || (okToCacheOpaque \u0026\u0026 res.type === 'opaque')) {\r\n                    return;\r\n                }\r\n                // If caching this response would make the cache exceed its maximum size, evict something\r\n                // first.\r\n                if (lru.size \u003e= this.config.maxSize) {\r\n                    // The cache is too big, evict something.\r\n                    const evictedUrl = lru.pop();\r\n                    if (evictedUrl !== null) {\r\n                        yield this.clearCacheForUrl(evictedUrl);\r\n                    }\r\n                }\r\n                // TODO: evaluate for possible race conditions during flaky network periods.\r\n                // Mark this resource as having been accessed recently. This ensures it won't be evicted\r\n                // until enough other resources are requested that it falls off the end of the LRU chain.\r\n                lru.accessed(req.url);\r\n                // Store the response in the cache (cloning because the browser will consume\r\n                // the body during the caching operation).\r\n                yield (yield this.cache).put(req, res.clone());\r\n                // Store the age of the cache.\r\n                const ageTable = yield this.ageTable;\r\n                yield ageTable.write(req.url, { age: this.adapter.time });\r\n                // Sync the LRU chain to non-volatile storage.\r\n                yield this.syncLru();\r\n            });\r\n        }\r\n```\r\n\r\n### Describe the solution you'd like\r\nCaching opaque responses in the freshness mode of dataGroups in ngsw-config.json\r\n\r\n\r\n### Describe alternatives you've considered\r\nhttps://medium.com/@sascha.wolff/how-to-use-angular-6-service-worker-for-dynamically-loading-images-f4f6f497699f\r\n","author":{"url":"https://github.com/borjapazr","@type":"Person","name":"borjapazr"},"datePublished":"2019-06-11T07:22:55.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":4},"url":"https://github.com/30968/angular/issues/30968"}

route-pattern/_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format)
route-controllervoltron_issues_fragments
route-actionissue_layout
fetch-noncev2:b7d53f67-750c-5f78-956a-5da551c0433e
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-idCEF4:3F83A1:AC697D:E6B894:6A600F1A
html-safe-nonce1e906ae4b7f4df45b53572d18fe0f7a70841a352d13bb641b0695d3c96fca73c
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDRUY0OjNGODNBMTpBQzY5N0Q6RTZCODk0OjZBNjAwRjFBIiwidmlzaXRvcl9pZCI6IjgxODY4NDM4Mjk5MjY2MjkxNDYiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ==
visitor-hmac9797ae153933019637a0d3b3898180c1eab1500aff4982de17bb511e16a3ff5b
hovercard-subject-tagissue:454521037
github-keyboard-shortcutsrepository,issues,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///voltron/issues_fragments/issue_layout
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/angular/angular/30968/issue_layout
twitter:imagehttps://opengraph.githubassets.com/5350e3e26329f3da7fdb1c3d7a2826ee1f20952173f50ff0e9b46d04390736c5/angular/angular/issues/30968
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/5350e3e26329f3da7fdb1c3d7a2826ee1f20952173f50ff0e9b46d04390736c5/angular/angular/issues/30968
og:image:altCaching opaque responses with freshness strategy in ngsw-config.json [PWA][SW] Relevant Package This feature request is for @angular/pwa. Description The SW might have an option to cache opaque res...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernameborjapazr
hostnamegithub.com
expected-hostnamegithub.com
None48cb2ed2304f8ae5a4a05d6327faf70466c4c0d9dcbf7b9df76251ca9c669a90
turbo-cache-controlno-preview
go-importgithub.com/angular/angular git https://github.com/angular/angular.git
octolytics-dimension-user_id139426
octolytics-dimension-user_loginangular
octolytics-dimension-repository_id24195339
octolytics-dimension-repository_nwoangular/angular
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id24195339
octolytics-dimension-repository_network_root_nwoangular/angular
turbo-body-classeslogged-out env-production page-responsive
disable-turbofalse
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
releasecb0f10a384099e0765239a7cc220992cae52bdba
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/angular/angular/issues/30968#start-of-content
https://github.com/
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fangular%2Fangular%2Fissues%2F30968
GitHub CopilotWrite better code with AIhttps://github.com/features/copilot
GitHub Copilot appDirect agents from issue to mergehttps://github.com/features/ai/github-app
MCP RegistryNewIntegrate external toolshttps://github.com/mcp
ActionsAutomate any workflowhttps://github.com/features/actions
CodespacesInstant dev environmentshttps://github.com/features/codespaces
IssuesPlan and track workhttps://github.com/features/issues
Code ReviewManage code changeshttps://github.com/features/code-review
Code QualityEnforce quality at mergehttps://github.com/features/code-quality
GitHub Advanced SecurityFind and fix vulnerabilitieshttps://github.com/security/advanced-security
Code securitySecure your code as you buildhttps://github.com/security/advanced-security/code-security
Secret protectionStop leaks before they starthttps://github.com/security/advanced-security/secret-protection
Why GitHubhttps://github.com/why-github
Documentationhttps://docs.github.com
Bloghttps://github.blog
Changeloghttps://github.blog/changelog
Marketplacehttps://github.com/marketplace
View all featureshttps://github.com/features
Enterpriseshttps://github.com/enterprise
Small and medium teamshttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
App Modernizationhttps://github.com/solutions/use-case/app-modernization
DevSecOpshttps://github.com/solutions/use-case/devsecops
DevOpshttps://github.com/solutions/use-case/devops
CI/CDhttps://github.com/solutions/use-case/ci-cd
View all use caseshttps://github.com/solutions/use-case
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
View all industrieshttps://github.com/solutions/industry
View all solutionshttps://github.com/solutions
AIhttps://github.com/resources/articles?topic=ai
Software Developmenthttps://github.com/resources/articles?topic=software-development
DevOpshttps://github.com/resources/articles?topic=devops
Securityhttps://github.com/resources/articles?topic=security
View all topicshttps://github.com/resources/articles
Customer storieshttps://github.com/customer-stories
Events & webinarshttps://github.com/resources/events
Ebooks & reportshttps://github.com/resources/whitepapers
Business insightshttps://github.com/solutions/executive-insights
GitHub Skillshttps://skills.github.com
Documentationhttps://docs.github.com
Customer supporthttps://support.github.com
Community forumhttps://github.com/orgs/community/discussions
Trust centerhttps://github.com/trust-center
Partnershttps://github.com/partners
View all resourceshttps://github.com/resources
GitHub SponsorsFund open source developershttps://github.com/open-source/sponsors
Security Labhttps://securitylab.github.com
Maintainer Communityhttps://maintainers.github.com
Acceleratorhttps://github.com/open-source/accelerator
GitHub Starshttps://stars.github.com
Archive Programhttps://archiveprogram.github.com
Topicshttps://github.com/topics
Trendinghttps://github.com/trending
Collectionshttps://github.com/collections
Enterprise platformAI-powered developer platformhttps://github.com/enterprise
GitHub Advanced SecurityEnterprise-grade security featureshttps://github.com/security/advanced-security
Copilot for BusinessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/enterprise/premium-support
Pricinghttps://github.com/pricing
Search syntax tipshttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
documentationhttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fangular%2Fangular%2Fissues%2F30968
Sign up https://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fvoltron%2Fissues_fragments%2Fissue_layout&source=header-repo&source_repo=angular%2Fangular
Reloadhttps://github.com/angular/angular/issues/30968
Reloadhttps://github.com/angular/angular/issues/30968
Reloadhttps://github.com/angular/angular/issues/30968
Please reload this pagehttps://github.com/angular/angular/issues/30968
angular https://github.com/angular
angularhttps://github.com/angular/angular
Notifications https://github.com/login?return_to=%2Fangular%2Fangular
Fork 27.5k https://github.com/login?return_to=%2Fangular%2Fangular
Star 101k https://github.com/login?return_to=%2Fangular%2Fangular
Code https://github.com/angular/angular
Issues 978 https://github.com/angular/angular/issues
Pull requests 162 https://github.com/angular/angular/pulls
Discussions https://github.com/angular/angular/discussions
Actions https://github.com/angular/angular/actions
Projects https://github.com/angular/angular/projects
Security and quality 24 https://github.com/angular/angular/security
Insights https://github.com/angular/angular/pulse
Code https://github.com/angular/angular
Issues https://github.com/angular/angular/issues
Pull requests https://github.com/angular/angular/pulls
Discussions https://github.com/angular/angular/discussions
Actions https://github.com/angular/angular/actions
Projects https://github.com/angular/angular/projects
Security and quality https://github.com/angular/angular/security
Insights https://github.com/angular/angular/pulse
Support caching opaque responses with freshness strategy in ngsw-config.json [PWA][SW]https://github.com/angular/angular/issues/30968#top
area: service-workerIssues related to the @angular/service-worker packagehttps://github.com/angular/angular/issues?q=state%3Aopen%20label%3A%22area%3A%20service-worker%22
type: bug/fixhttps://github.com/angular/angular/issues?q=state%3Aopen%20label%3A%22type%3A%20bug%2Ffix%22
needsTriagehttps://github.com/angular/angular/milestone/83
https://github.com/borjapazr
borjapazrhttps://github.com/borjapazr
on Jun 11, 2019https://github.com/angular/angular/issues/30968#issue-454521037
https://medium.com/@sascha.wolff/how-to-use-angular-6-service-worker-for-dynamically-loading-images-f4f6f497699fhttps://medium.com/@sascha.wolff/how-to-use-angular-6-service-worker-for-dynamically-loading-images-f4f6f497699f
area: service-workerIssues related to the @angular/service-worker packagehttps://github.com/angular/angular/issues?q=state%3Aopen%20label%3A%22area%3A%20service-worker%22
type: bug/fixhttps://github.com/angular/angular/issues?q=state%3Aopen%20label%3A%22type%3A%20bug%2Ffix%22
needsTriageNo due datehttps://github.com/angular/angular/milestone/83
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Viewport: width=device-width


URLs of crawlers that visited me.