How to create a browser level image caching in hippo cms. Also suggest me how to do that in my local - hippocms

I want to know about how to leverage browser level caching and specially image caching in Hippo CMS. Also it would be great if somebody can suggest me how to do that in my local hippo setup.

You can set cache headers on your pages. This can be done in your component class.

Related

The Cost of Applying SSR on server - Laravel & Vue

I dont know is this a right place to ask this question, so i planned to make a blog website with SPA (Single Page Application) model using vuejs, we all know SPA websites are not SEO friendly and we need SSR or Prerendering to overcome this problem.
From some source on the internet i found out that apllying SSR to a Website make it consume more server resource and i need to upgrade my hosting plan if needed and it will affect to my website operating cost.
can you guys give me advice what should i do?
from your experience did ssr cost server resources that much?
should i make my website without javascript framework and using fully dynamic php page?

How to render a template in VueJS to be used on index.html

We have Rails app with Webpacker that serves just the initial HTML file, after which the client will download everything (inc. vue .js and .css) files.
Our problem is that we want to display something initial on the html so the user will feel as the site already loaded. This logic is in the main vuejs component. Is there a way to offline render this so it will be easily be embedded on our index page? instead of having to maintain and re-write this everytime?
It sounds like pre-rendering might be a better fit for you than full-on SSR. Since you're already rolling Webpack, there is a plugin that helps to that end called prerender-spa-plugin: https://github.com/chrisvfritz/prerender-spa-plugin
The idea behind this plugin is that, as part of your build process, it prerenders the resulting static HTML of your SPA using Puppeteer (i.e. headless Chrome), and drops it into your static HTML folder. It maintains links to your SPA code so it's still fully functional, it's just fully rendered by the time the user hits it.
What I'd suspect you'd want to try is the following:
Add the prerender-spa-plugin to your webpack.config.js
Configure the plugin to prerender your initial route and any additional routes that are truly static
Output the resulting files to the folder your Rails app uses to distribute static assets (HTML, CSS, images, etc)
Going the pre-render route is actually technically superior to SSR for truly static routes like a landing page or marketing pages. You won't need to mess with a complex pre-render setup on your Rails server, you offload content distribution to the static folder (i.e. lesser load on your Rails server), and you still get to use all the benefits of your SPA.
That being said, if you strongly feel like you do need full-blown SSR, the generally "accepted" approach is rolling a Node.js server (https://ssr.vuejs.org/). If you decide to go down this route, I'd keep your SPA assets in their own separate Git repo from your Rails server and manage DevOps appropriately.
Good luck!

How to make reactjs serve static pages for SEO

I have this reactjs webapp - http://52.26.51.120/
It loads a single page and then you can click links to dynamically load other boards on the same page... such as 52.26.51.120/#/b, 52.26.51.120/#/g
Now the thing is, I want each of these to be an individual page, for the purpose of seo. I want you to be able to google "my-site.com g", and you will see the result 52.26.51.120/#/g. This obviously cant work if you are using reactjs and it is all on one page. Google will only render and cache that main page (can it even render that page? does google execute javascript?)
Even more specifically, id want something like my-site.com/g/1234 to load a thread. There could be a thousand threads every day, so im not sure how to handle that.
Are there any solutions to this? to allow react to possibly serve up static pages as html so that they can be cached on google? I am using expressjs and webpack as my server right now, and all the code is executed in jsx files.
Thanks
You can use Prerender.io service. In a nutshell you will need to connect your server app or web server with prerender service and do little setup (see documentation). After that search engines and crawlers will be served with a static (prerendered) content while users will get classic React.js (or any other single page) app.
There is a hosted service with free tier or open source version
I suspect you could do some smart configuration with nginx and it could convert a url of domain/board to a redirection of domain/#/board when detecting the user-agent as a bot instead of a typical user.

Does Providing CDN increases SEO of a website

I am developing a php script and it will be free to download for the users, if use css,js files hosted in my network in the script and they install it. So every user who uses my script will load my websites css,js files.
Will that increase SEO of my website ?
your ask is no !!
because its not important for GOOGLE and don't influence for SEO because it dont make BACKLINK for your website .
js and CSS files are'nt link
Yes,of course .
CDN increase your load page for users.
CDN increase your security for users.
CDN affect for mobile users.

IBM Worklight: downloading and replacing resources from webview

What I want to do is displaying a website (a Portal one) within Worklight. So I'm hardcoding the URL in the mainFile tag:
<mainFile>http://example.com/page.html</mainFile>
Now I need to download the resources from this page (JS and CSS files), store them locally and replace the absolute URLs of the page with WorkLight URLs in order to speed up the page loading.
How could I do this?
You cannot change the mainFile (the "index.html") value during runtime, as it is set in application-descriptor.xml which is a server-side file that the build process uses.
I would also question the flow. If you want to speed up application loading, hinting that by using Portal the loading is slow, why use Portal to begin with? Place your resources locally in the application.