question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[0.17 beta] Feature request: add option in quasar.conf for user agent

See original GitHub issue

Since SSR uses a lot of CPU, on one of our servers we render just for a specific user agent like for exaple if the user agent is twitterbot, we use Nginx to make the decision like(the following is Nginx configurations code snippet):

if ($http_user_agent ~* "baiduspider|twitterbot|facebookexternalhit|rogerbot|linkedinbot|embedly|quora link preview|showyoubot|outbrain|pinterest|slackbot|vkShare|W3C_Validator") {
    set $prerender 1;
}

I wish if I can specify in quasar.conf file for which user agent we want to use the SSR but for the others send them the SPA/PWA files as static files without rendering them.

Can you add this feature, please?

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
MohammedAl-Mahdawicommented, Jul 17, 2018

Hi @rstoenescu thank you so much, I understand, I’m going to work on this and will update here when I get any progress in case if anyone faced a similar issue in the future.

1reaction
rstoenescucommented, Jul 17, 2018

When you build for SSR then the distributable code is SSR specific (as it needs to be). You can’t just serve the created “www” folder without it being rendered within a SSR context.

However, you can create two builds (one for SSR, one for SPA/PWA), put them on your server, then mangle with the production server (mentioned earlier - src-ssr/index.js) to distribute the requests accordingly to the User Agent. Make some Google searches on express if it’s too foggy or you don’t know where to begin. As a last resort, if mangling with express doesn’t works, I suggest that you make a deployment script so you don’t have to repeat the same deployment steps “by hand”.

This pretty specific request cannot be managed from a quasar.conf property, unfortunately, so you have to do it yourself in src-ssr/index.js.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Configuring quasar.conf.js
js is run by the Quasar CLI build system, so this code runs under Node directly, not in the context of your app....
Read more >
Configuring quasar.config.js
config. js is run by the Quasar CLI build system, so this code runs under Node directly, not in the context of your...
Read more >
Untitled
Exceeds, Alison krauss waltz of the wind, How to use a joint roller grasscity, Ep electric pallet truck, Machine autobronzante, Pygtk textview, ...
Read more >
Untitled
Ventless gas fireplace insert lowes, Deadpool logo hoodie, Panah saz iran ... User agent string ios 6.1.2, Booger games online free, Major pem...
Read more >
CISA All NCAS Products - RSSing.com
Table 1: Quasar client builder feature options and attributes ... Requests that are visible to the host user use the User Agent string...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found