Ranter
Join devRant
Do all the things like
++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatar
Sign Up
Pipeless API
From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple API
Learn More
Comments
-
I wonder what do they have in that? Entire site map and use visible/hidden for valid items :\?
-
They also downloaded the entire bakery and the wheat fields that the breadcrums come from
-
@ScriptCoded aah sorry, well it is almost 1MB for a simple navigation? That shouldn't exceed few KBs unless all website navigation is thrown inside of it
-
bioDan61596y@gitpush @ScriptCoded , my guess is to minimize requests to the db.
Many websites have all the breadcrumbs stored in a table on the db. Subsequently, on every page view they query the db to get the associated list and links of the breadcrumbs.
By having an sql dump of the breadcrumbs table in a json format file, you can simply stream it to the user without querying the database on each pageview by any user (disregarding caching ofcourse).
Then you can automatically regenerate that json file each time you create or modify a page.
Anyway, its for performance optimization on their servers. -
bioDan61596y@gitpush true, the stress will be more on the client side.
But its cheaper for a company in terms of resource allocation (especially if its a big company with millions of monthly visitors)
The company can even optimize it so the json is stored in the users' local storage and perform the XHR only in cases where the key in localstorage doesnt exist or the cache key had changed. -
@bioDan I'm not a web dev, but wouldn't a better solution is to dynamically generate navigation based on page title and link?
-
@bioDan We're not allowed to store any data client-side. All request are flagged no-cache
-
bioDan61596y@010001111 that's sad. I feel your pain.
If you want to decrease the size of the json you can try to gzip it or encode it in base64.
Yes, this is the JSON response for a site's breadcrumb.
rant
xhr