[0.17 beta] Feature request: add option in quasar.conf for user agent
See original GitHub issueSince 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:
- Created 5 years ago
- Comments:5 (2 by maintainers)
Top 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 >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
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.
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.