21

Yes, this is the JSON response for a site's breadcrumb.

Comments
  • 3
  • 4
    @ScriptCoded That's a breadcumb
  • 3
    I wonder what do they have in that? Entire site map and use visible/hidden for valid items :\?
  • 10
    They also downloaded the entire bakery and the wheat fields that the breadcrums come from
  • 1
    thoughts and prayers...
  • 2
    @gitpush Yes, I know, but what's interesting about that file?
  • 1
    @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
  • 2
    @gitpush Oh now I see. That's actually kind of absurd
  • 2
    @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.
  • 1
    @bioDan but sending it for client side parsing is an issue.
  • 3
    @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.
  • 2
    @bioDan I'm not a web dev, but wouldn't a better solution is to dynamically generate navigation based on page title and link?
  • 2
    @bioDan 100% but our servers are still too slow with that "simple" request
  • 2
    @bioDan We're not allowed to store any data client-side. All request are flagged no-cache
  • 1
    @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.
  • 1
    @gitpush title - not really. Link - maybe, it depends, but still is pretty tricky.
  • 2
    @bioDan isn't base64 an increase in size?
  • 2
    @KDSBest Yes, about 33% I believe
  • 2
    @KDSBest yes it is, my bad
  • 0
    But you can print it out end send it by snail mail
Add Comment