When not to use AJAX client-side routing? [closed] - ajax

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 8 years ago.
Improve this question
Using client-side routing (with Angular's $routeProvider for example), it is possible to load a whole web app at once and not interact with the server anymore.
However this might imply a long load time when visitors first open the web app assuming it has a lot of views.
What are the best practices in terms of client-side routing vs. initial load time?

Well the default behaviour of angular is to have the whole app front loaded. But it depends what your app does and how big it is. If it's a small app you could do that. If your app is huge (unlikely given all the app will do is just show some static data) then it's not really a good idea to load everything up front. For a smaller app it would be OK, especially if you minify everything. But for larger apps, what if you have 10MB of scripts and resources? You're putting a lot of strain on your server and eating your customers bandwidth. Fr large apps you could dynamically load scripts as routes change, we do something similar to this in a pretty huge angular app.
The best practice would be to only get the files that are required to generate the content you want to show to the user on that specific route, which goes against what you want to do. Regarding "not interact with the server anymore", well if your app relies on a server to get some data or do some authentication, you can't really stop interacting with the server.

Related

What are the possible ways of storing web contents ( images,videos,pdf etc)? [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 4 years ago.
Improve this question
We are planning to host one web app which uses multiple resources like banner images, videos, pdf and they need to be changed by time. If we package those resources in app, app size will get increased and in every change we need to repackage and redeploy.
So we have planned to have aws S3 and cloudFront cdn for serving all static web content and we can use them in application.
Please suggest pros and cons of our architecture and other possible ways of achieving it.
Yes. AWS S3 is indeed a very good choice for hosting your static assets.
As stated by AWS itself :
S3 is a highly durable, highly available, and inexpensive object
storage service that can serve stored objects directly via HTTP. This
makes it wonderfully useful for serving static web content directly to
web browsers for sites on the Internet.
What does your "app" do? Is it just to display static content? Or does it have a solid backend?
Since it is unclear, to get started, here is a wonderful resource from the official AWS site :
https://aws.amazon.com/getting-started/projects/build-modern-app-fargate-lambda-dynamodb-python/
They have clearly explained how to host your static content and structure your web app.
The pros of using AWS S3 are that it's really cheap, easy to use and configure.
Cons are ,IF you are just hosting static content, you will be charged for it.Why not use Github pages? It's entirely free!
You could use Azure Blob storage. You may store any file format and it can be secured with a security token for restricted access. It scales without limit and is considered a best practice for large volume web traffic. Hope it helps.

WCF REST to web API [closed]

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 5 years ago.
Improve this question
I want to migrate from wcf rest services to web API, (around 30 endpoints to be created with 6 complex methods) just want to decide based on the budget (1 month time with one resource) available, which amongst the below would be a better solution.
Writing whole new code for creating web API, just utilizing logic already present in wcf rest services.
Creating API endpoints and calling wcf services inside that.
There is no real way to tell for sure without knowing more details (or maybe the entire project).
If you're not sure the time will be enough, one thing you can do is to start with option 2 and then replace each endpoint with the actual code from the WCF service. If one month proves to not be enough, you may end up with a mixed solution (where some methods are implemented in the Web Api and some are wrappers calling the WCF service). However, you will be able to just keep slowly moving the methods back to the Web Api and finish it eventually.

To store images in file system, database, or blob? [closed]

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 5 years ago.
Improve this question
I have roughly 600 static images that I need to store and use for my web app and I was wondering what kind of options I have for this application.
What is the typical procedure?
What are my options, and what are the pro's and con's of each?
Thanks ahead of time.
You should store static resources that you want to serve from your site somewhere under the wwwroot folder. I recommend putting them in an images subfolder, but you can use whatever organization works for you. There are many reasons why it can be worthwhile to use a Content Delivery Network (CDN) for serving your static resources, including scripts, stylesheets, and images, in which case you might want to store your images there. For example Amazon CloudFront is an inexpensive CDN service you can use for this purpose. This will speed up your page load times since the images will load in parallel with your site's assets, it will reduce load on your server, and the CDN server will host the images on edge servers that are geographically close to the client (so clients on the other side of the world from your server will get the files faster than if they loaded them from your server).
Overall this isn't so much an ASP.NET Core question, but a general web site question. ASP.NET Core will serve static resources (as long as you have the static files middleware installed), but other than that it doesn't have a lot to do with it. Just put the files under wwwroot and you're good to go unless you think it's worth using a CDN.

How to cache every call made for an offline web experience [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 8 years ago.
Improve this question
I'm going up to the mountains with no internet connection to present something. I'd like to be able to use interactive examples since I'll be presenting on a certain website.
So is there a way I can set up a proxy caching server or something to cache every call made in order to have a fully cached website experience with no internet connection?
I've looked at http://squidman.net/ but I'm not sure how it works or how to use it.
You might want to try something like this. It might be a lot more work than the steps below, but this could be a good starting point.
Create a local proxy server along with memcache or redis
Update the browser proxy settings to use your proxy server details
Make the local server look for the url in the redis server.
If found, return the data in the redis server
Else, do a web request and store the data in the redis server
You'll have to do this manually for the pages that you want while you have the internet connection. Once you've got all the data you need, you can work without the internet connection too.
If the pages are essentially static then you could use something like HTTrack http://www.httrack.com/ to make an offline copy
If there's anything requiring server side interaction or dynamic generation of pages you're most likely going to need to run your own local instance of the server.

Web Page based Winsock [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 9 years ago.
Improve this question
Is there a web page based version of vb6's Winsock?
I want a web page to send a message to a vb6 program on a different PC.
Any Examples would be great help, thank you
Short answer: No.
Longer answer: You could create a VB6 ActiveX control, but it would be impractical to use due to security lockdown in most IE instalaltions and lack of support in alternative contrarian browsers.
Real answer: You are probably going to look at using some sort of scriptable HTTP Request component (such as XmlHttpRequest) though you must consider cross-domain request security even then. The "VB program on a different PC" would need to be an HTTP server or run under one via classic ASP, as a CGI application, etc.
And of course there would need to be a path from the client web page to the server (i.e. you have firewall and NAT issues to address) in any case.

Resources