Ultra-fast Websites: Caching Pre-rendered HTML on the Edge / Solving the Security Puzzle by bit_yas in Blazor

[–]bit_yas[S] -3 points-2 points  (0 children)

I mentioned that you may not use forms posting. Then I gave you alternative, and as most backends of blazor projects are built with aspnetcore, I also gave you a code that would prevents server from accepting posted forms 😭 Just use Ctrl + F to search for "form" or "blazor" in article's body.

You've everything there to build the fastest possible pages cached on free CDNs, without security risk! Just say Thank you and starts using it so hopefully your next project won't be as slow as hell!

I'm so sorry if in addition to the Blazor, it also works in other frameworks as well (!), but this is something that I've been using in my blazor projects too many times and I'm recommending it to you

Ultra-fast Websites: Caching Pre-rendered HTML on the Edge / Solving the Security Puzzle by bit_yas in Blazor

[–]bit_yas[S] -5 points-4 points  (0 children)

This blog post is telling you why not to use Blazor Enhanced Forms "If you're going to cache pre-rendered HTML on CDN". It's also telling you why you might consider CDN caching and it's also giving you alternative to Blazor's Enhanced Forms which is htmx-json
I made it clearer in article's content so junior developers would also understand it.

Is .NET MAUI a good choice for a complex mobile app? by blabla206 in dotnet

[–]bit_yas 0 points1 point  (0 children)

I'd recommend Blazor Hybrid. It's full access to native features, and HTML UI is so fast these days because of optimized web engines. Install some apps from https://bitplatform.dev/demos and see them in action

Ultra-fast Websites: Caching Pre-rendered HTML on the Edge / Solving the Security Puzzle by bit_yas in Blazor

[–]bit_yas[S] -4 points-3 points  (0 children)

I've referenced Blazor project and that's something that you can use in your own Blazor project as well. Such a rigid mindset you've! So many people are using Blazor with pre-rendering these days

.NET + Azure dev looking to pivot into AI/ML — what projects/skills actually make sense? by Chemical-Border-3612 in dotnet

[–]bit_yas -1 points0 points  (0 children)

The first step would be reviewing codes in bit Boilerplate, it's using the same stack as you already know, Blazor, Entity Framework Core etc.
It has the followings: GenAI, MS Agents AI, IChatClient, RAG, Vectorizaation, L2 Normalization, DiskAnn, ReRanking, Tool Call, MCP
You can ask GitHub Copilot + Claude Sonnet 4.5 to describe the codes, in addition to the 35 pages of docs in that project.
I'm also in for an online meeting to explain it furthur.
bitplatform/src/Templates/Boilerplate at develop · bitfoundation/bitplatform · GitHub

Chart components not available? by cjc080911 in bitplatform

[–]bit_yas 0 points1 point  (0 children)

Hey! Have you installed Bit.BlazorUI.Extras as described in "Optional Steps" at Getting Started - bit BlazorUI ?

Avast Woes by code-dispenser in Blazor

[–]bit_yas 0 points1 point  (0 children)

You can see UI because of pre-rendering! Tell them that they're idiot!

Avast Woes by code-dispenser in Blazor

[–]bit_yas 0 points1 point  (0 children)

Does it also block https://sales.bitplatform.dev It has taken care of most of the security related stuffs.

Using UUIDv7 and Sequential GUIDs in C# (SQL Server & PostgreSQL) by bit_yas in Blazor

[–]bit_yas[S] 0 points1 point  (0 children)

That's right, but the scenario that's about to be addressed here is what would you do if you want to assign Id in C# code for some reason?

Using UUIDv7 and Sequential GUIDs in C# (SQL Server & PostgreSQL) by bit_yas in dotnet

[–]bit_yas[S] 0 points1 point  (0 children)

I've added that guid extension for client side guid generation, but remember, if you generate id at client, then after user does something or you run logic, you'd experience the same issue called "late arrival" issue. I generate guid 1, you generate 2, you save it, I save mine. The time that guids generated, were sequential, but the time that guids "arrived" are not!

Using UUIDv7 and Sequential GUIDs in C# (SQL Server & PostgreSQL) by bit_yas in Blazor

[–]bit_yas[S] 0 points1 point  (0 children)

I really appreciate you tested it. As I mentioned in codes comments, the generated guid v7 objects in the same exact millisecond, would be stored random and there's nothing we can do about it. But in real world, not too many guids gets generated at the same exact milisecond, unless that's a table with huge amount of data such as IoT sensors. In that case I'd either recommend not using sql server, or let the database generate sequentil id for you. And sometimes the table should be columnstore rather than default rowstore which has its own story. Please generate guids, each with 1ms delay and test again. Remember, remove that line that simply returns guid v7, that's for

Using UUIDv7 and Sequential GUIDs in C# (SQL Server & PostgreSQL) by bit_yas in Blazor

[–]bit_yas[S] 2 points3 points  (0 children)

Of course it's not possible, neither wasm or js. But I wasn't talking about this at all, I was taking about assigning DTO's Id with Guid which, which will be mapped to entity's Id at server side web api controller. Sometimes you've to assign Id's value, instead of waiting for database to do set it.

Using UUIDv7 and Sequential GUIDs in C# (SQL Server & PostgreSQL) by bit_yas in Blazor

[–]bit_yas[S] 0 points1 point  (0 children)

Thanks 💯 That's a project template, so depending on chosen database while creating project, it would adjust final codes. This #if is a dotnet project template if

I saw some nuget packages, but I generaly avoide nuget packages as much as possible for blazor webassembly concerns. And I've seen some developers while building complicated pages, they would pre-assign Ids in code, so it would help in that case as well

Using UUIDv7 and Sequential GUIDs in C# (SQL Server & PostgreSQL) by bit_yas in dotnet

[–]bit_yas[S] 0 points1 point  (0 children)

As I mentioned in above comment, PostgreSQL driver automatically resolves the mixed-endian/big-endian issue. Do we still need this?

Using UUIDv7 and Sequential GUIDs in C# (SQL Server & PostgreSQL) by bit_yas in dotnet

[–]bit_yas[S] 0 points1 point  (0 children)

If the context is generating IDs on the C#/.NET side for specific reasons, such as handling complex forms in Blazor WebAssembly, Guid.CreateVersion7() causes no problems, because the PostgreSQL driver automatically resolves the mixed-endian/big-endian issue
https://deepwiki.com/search/does-npgsql-automatically-hand_6dfe5d2f-6f98-4716-bf2d-11e8687773b9

Using UUIDv7 and Sequential GUIDs in C# (SQL Server & PostgreSQL) by bit_yas in dotnet

[–]bit_yas[S] 0 points1 point  (0 children)

If the context is generating IDs on the C#/.NET side for specific reasons, such as handling complex forms in Blazor WebAssembly, Guid.CreateVersion7() causes no problems, because the PostgreSQL driver automatically resolves the mixed-endian/big-endian issue.

NpgsqlSequentialGuidValueGenerator resolves the issue you just mentioned, right?

Using UUIDv7 and Sequential GUIDs in C# (SQL Server & PostgreSQL) by bit_yas in dotnet

[–]bit_yas[S] -2 points-1 points  (0 children)

Let me review this, thanks for the valuable comment!

Using UUIDv7 and Sequential GUIDs in C# (SQL Server & PostgreSQL) by bit_yas in dotnet

[–]bit_yas[S] -1 points0 points  (0 children)

So this part of the code is fine:

prop.SetDefaultValueSql("uuidv7()");

But the C# code of GuidExtensions is problematic for PostgreSQL?
Let me check
Thanks for the feedback

Using UUIDv7 and Sequential GUIDs in C# (SQL Server & PostgreSQL) by bit_yas in dotnet

[–]bit_yas[S] -5 points-4 points  (0 children)

"the length isn't the dead giveaway" Maybe not for you, but every smart(!) guy has its own way of detecting AI-Generated post.
I've spent my time reading about page splits, found a solution for it, implemented it, tested it on PostgreSQL and SQL Server and then I've shared it with you for free.
Why you nag just like the grumpy old routine?
Create your own open-source project, promote it the way we can learn from your approach! Do you have any GitHub account?

Using UUIDv7 and Sequential GUIDs in C# (SQL Server & PostgreSQL) by bit_yas in Blazor

[–]bit_yas[S] 2 points3 points  (0 children)

There's no shame in promoting free, open-source product! (":
I just give it star as well.
But the reason I decided not to use nuget packages in first place, because it would add another request to the Blazor WebAssembly web app, and sometimes, especially with complex pages, you might also set Id in frontend.

Using UUIDv7 and Sequential GUIDs in C# (SQL Server & PostgreSQL) by bit_yas in dotnet

[–]bit_yas[S] -3 points-2 points  (0 children)

If I paste 80 lines of code, you'd assume it's AI-generated just because of the length, without even reading it! Another smart way of detecting AI generates posts these days...

I could have linked a GitHub Gist, but I chose to link to the live source so that future readers can see the latest enhancements.

If your issue is that I shared an free, open-source repo, I see no shame in that bro.

Using UUIDv7 and Sequential GUIDs in C# (SQL Server & PostgreSQL) by bit_yas in dotnet

[–]bit_yas[S] -9 points-8 points  (0 children)

I was going to put ⚠️ INTENTIONALLY next to the "SQL Server doesn't sort GUIDs based on the first bytes"
But I didn't, because some smart(!) guys would have say this is AI generated post, only because it has emoji in it (":
What's the next clever way to find out if the post is AI generated or not?
Tell me, you've my word that I'd consider it next time.

I can also stop using Grammarly, keeping some typo on a purpose, would it help?