samedi 1 juillet 2017

Why does IMDB use full page Postbacks for Navigation?

I noticed that IMDB requires a full page postback to navigate to a new page. This is particularly strange to me because I have always been told that full page postbacks are wasteful - given that there is always some common markup that you can save by avoiding them.

For example, in case of IMDB, the header and footer contents are (almost) always going to be identical across two pages that you browse. So it would (normally) not make sense to resend that set of markup on every request.

One of the reasons I can guess is that the site caches entire pages. This would at least make sense for cases when user navigates to popular pages (movies, shows or actors) given that they are likely to be in the cache - resulting in faster response.

However, the benefit of such caching can still be availed using templates (such as those in React JS.) So, the reason to not use partial postbacks still eludes me! Particularly so, because Wappanalyzer on my Chrome thinks IMDB uses React JS!

I believe there would be a good reason for the way IMDB works. So the only question is, what am I missing? How are full page postbacks technically justified?




Need help in creating a web app [on hold]

I am here for asking which framework to use to build a web app with which will act as a centralized school management web app. It will house more than millions of students, teachers, parents, staffs etc. I am concerned with Language to use, what web server to use, which database to use, would load balancing be required, etc. Can someone help me out? Oh about me, I am familiar with PHP and its Frameworks, Node.js, Python as language, Nginx in web server, MariaDB/MySQL as database server, worked on Redis and Varnish Caching servers. Also which CLoud services would be alright. I have used Google Cloud and Amazon, though I found Google easy to use.




Why I am getting this JavaScript Error : Cannot read property 'style' of null [duplicate]

This question already has an answer here:

I just started learning DOM Manipulation and want to do a simple task of changing the font color of h1 using javaScript but I am getting this error - "Cannot read property 'style' of null ". My js file is connected to html but the next line is not working. Please help.

demo.html

<!DOCTYPE html>
<html>
<head>
    <title>My Site</title>
    <script type="text/javascript" src="demo.js"></script>
</head>
<body>
<h1>My Website</h1>
</body>
</html>

demo.js

alert("connected");
var h1=document.querySelector("h1");
h1.style.color="pink";




How to add a live radio to your website?

I've been trying to find out how to program a web page where I can record audio from my house live and stream it to anyone who opens the web page. If someone could recomend me where to look for information about this it would be very helpfull. Thank you.




(PHP/Postgresql) Call a function which returns void?

I'm getting crazy trying to call, inside PHP code, a function that returns void, with pg_prepare/pg__execute...

$result = pg_prepare($dbconn, "",'SELECT * FROM dungeonasdb.crea_personaggio( "$nome", "$descrizione", "$email", "$password")');
$result = pg_execute($dbconn, "", NULL ) or die('Query creazione fallita');

Is there any settings of pg_prepare/pg_execute that I do wrong? Thanks




.htaccess vanity url not redirecting properly

I've got a blog subdirectory on my website (foo.com/blog), and I'm following a tutorial that offers a brief explanation of vanity urls.

Basically, I'm trying to get it so that when the user navigates to 'foo.com/blog/xyz' the 'xyz' variable (username) redirects the user to:

http://ift.tt/2srwsCt 

but still displays as:

foo.com/blog/xyz

The code in the tutorial doesn't work, so I've been relying on code in the youtube comments under it:

RewriteBase /

RewriteEngine on
RewriteCond %{REQUEST_FILENAME} -f [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule .* - [L]
RewriteRule ^(.*)$ http://ift.tt/2taRDpz [NC]

The problem is, when I try to navigate to 'foo.com/blog/xyz' it instead redirects to:

http://ift.tt/2srJQq4

So obviously the username is being set to blog/xyz instead of xyz itself.

Likewise, if navigate to foo.com/xyz, it redirects to where it is supposed to go:

http://ift.tt/2taYwXL

But displays this url as it is instead of showing up as foo.com/blog/xyz (like how reddit shows up as http://ift.tt/2srlE7A for users)

So it appears I have two problems:

  • 1) I can't figure out how to make it so that it only does the rewrite when I navigate to foo.com/blog/xyz rather than foo.com/xyz (.htaccess is in public_html -- I tried moving it to public_html/blog but it didn't work)

  • 2) I can't figure out how to get it to display as blog/xyz instead of blog/profile?php?username=xyz

I don't know much about apache, and I really just need to get this one piece of code right so I can continue bashing my head against the wall with the rest of the tutorial. Does anyone know what I'm doing wrong?




how to use steam trade url in my website using c# code

I want to use steam trade url in my website,and want to show items in gridview using steam trade url link.Anyone can suggest me what is the process.