Repository: sveltejs/kit

Issue #5699: SSR Only Routes
Created: 2022-07-25T04:29:52Z
Describe the problem
In the fine-print of many API services, there is a clause to not re-distribute the data of the service API in another API. Sometimes parts of our apps will need to use these third-party data-sources. We may not necessarily have the license to distribute said data as json.
Another example: needing to show advertisement along with articles! We don't want someone to directly access our API and just read articles without our ability to monetize with ads! With full HTML render, ads will also be sent along.
Describe the proposed solution
SSR-only routes--routes without __data.json or that do not respond to application/json request headers, insure that we are not re-distributing API data in a way licensing does not allow.
Old school SSR. No API endpoints. Also, all endpoint point to this route should not try __data.json. With regard to prefetching, the browser does have a <link rel="prefetch" href="foo/bar" /> option, and perhaps a mouse over could get the browser to start a prefetch the HTML5 way for SSR only routes.
SSR-only routes living along side with smart hybrid rendered routes. It would be glorious.
Alternatives considered
Hand-crafting GET exports to fail on JSON requests use a proxy server to prevent JSON content going out from certain routes. Bleh.
Also needing to place sveltekit:reload on all inbound links as well. May even need to write custom logic to include HTML5 prefetching as well (ie, <link rel="prefetch" href="foo/bar" />). Tedious bookkeeping. Would be great if there was a compiler that could do this for us.
Importance
would make my life easier
Additional Information
No response

Duplicate issue #6573: Replacing `GET` with `load` in `+page.server.js` creates issues with navigating back
Created: 2022-09-05T01:28:47Z
Describe the bug
Prior the GET function would return data in a very similar way to load, however, if a page was linked to via sveltekit:reload (in prior version) and the user navigated away from that page then clicked back, all was well.
Now with load function instead, clicking to another page and then using the back button triggers a call to __data.js even if data-sveltekit-reload is provided on the inbound link.
Reproduction
To reproduce:
https://stackblitz.com/edit/sveltejs-kit-template-default-6rejvf?file=src%2Froutes%2Ftodos%2F%2Bpage.server.js,src%2Flib%2Fheader%2FHeader.svelte&terminal=dev

Click TODO
Click ABOUT
Right-click and choose "back"

Expected:
Behavior like with previous GET verb being available. After repeating this from step 1-3, click "back" would not fail.
Logs
No response
System Info
MacOS 12.5, Chrome 104, SvelteKit 1.0.0-next.465
Severity
blocking an upgrade
Additional Information
This is part of a need for a route to only render SSR no matter how it is visited. Never call __data. At least bring back the old GET functionality; although not sure if that might have the same problem after some cache is invalidate.

Closing comment (2022-09-05T11:56:36Z): Pretty sure this behaviour hasn't changed since load was called GET, and that you're seeing something else. Regardless, this, like #6574, is effectively a duplicate of #5699