<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	xmlns:series="https://publishpress.com/"
	>

<channel>
	<title>dang cao, Author at Tomoshare</title>
	<atom:link href="https://blog.tomosia.com.vn/author/dang-cao/feed/" rel="self" type="application/rss+xml" />
	<link>https://blog.tomosia.com.vn/author/dang-cao/</link>
	<description>Kênh chia sẻ kiến thức Tomosia Việt Nam</description>
	<lastBuildDate>Thu, 12 Mar 2026 07:35:11 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.9.4</generator>

<image>
	<url>https://blog.tomosia.com.vn/wp-content/uploads/2023/09/cropped-icon-32x32.png</url>
	<title>dang cao, Author at Tomoshare</title>
	<link>https://blog.tomosia.com.vn/author/dang-cao/</link>
	<width>32</width>
	<height>32</height>
</image> 
	<item>
		<title>Tối ưu SEO cho Laravel Inertia.js với Vue 3 + Docker + Nginx (Phần 2)</title>
		<link>https://blog.tomosia.com.vn/toi-uu-seo-cho-laravel-inertia-js-voi-vue-3-docker-nginx-phan-2/</link>
					<comments>https://blog.tomosia.com.vn/toi-uu-seo-cho-laravel-inertia-js-voi-vue-3-docker-nginx-phan-2/#respond</comments>
		
		<dc:creator><![CDATA[dang cao]]></dc:creator>
		<pubDate>Thu, 12 Mar 2026 07:35:09 +0000</pubDate>
				<category><![CDATA[PHP]]></category>
		<guid isPermaLink="false">https://blog.tomosia.com.vn/?p=3981</guid>

					<description><![CDATA[<p>Một hướng dẫn thực tế dành cho các dự án Laravel + Inertia.js + Vue 3 chạy trong&#8230;</p>
<p>The post <a href="https://blog.tomosia.com.vn/toi-uu-seo-cho-laravel-inertia-js-voi-vue-3-docker-nginx-phan-2/">Tối ưu SEO cho Laravel Inertia.js với Vue 3 + Docker + Nginx (Phần 2)</a> appeared first on <a href="https://blog.tomosia.com.vn">Tomoshare</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<blockquote class="wp-block-quote is-layout-flow wp-block-quote-is-layout-flow">
<p>Một hướng dẫn thực tế dành cho các dự án Laravel + Inertia.js + Vue 3 chạy trong Docker với Nginx, tập trung vào SEO kỹ thuật (technical SEO) và hiệu năng.</p>
</blockquote>



<hr class="wp-block-separator has-alpha-channel-opacity"/>



<h2 id="1-tong-quan-kien-truc" class="wp-block-heading">1. Tổng quan kiến trúc</h2>



<p>Một stack phổ biến hiện nay:</p>



<ul class="wp-block-list">
<li><strong>Backend</strong>: Laravel</li>



<li><strong>Frontend</strong>: Vue 3 thông qua Inertia.js (SPA-like)</li>



<li><strong>Web server</strong>: Nginx</li>



<li><strong>Môi trường</strong>: Docker / Docker Compose</li>
</ul>



<p>Vấn đề lớn nhất với SEO trong mô hình này:</p>



<ul class="wp-block-list">
<li>Nội dung render phía client (CSR)</li>



<li>Bot Google có thể crawl được JS nhưng <strong>chậm</strong> và <strong>không ổn định</strong></li>



<li>Thiếu metadata động</li>



<li>TTFB cao nếu cấu hình Docker/Nginx chưa tối ưu</li>
</ul>



<p>Mục tiêu:</p>



<blockquote class="wp-block-quote is-layout-flow wp-block-quote-is-layout-flow">
<p>Làm cho website <strong>crawl được – index đúng – load nhanh – metadata đầy đủ</strong>.</p>
</blockquote>



<hr class="wp-block-separator has-alpha-channel-opacity"/>



<h2 id="2-hieu-dung-ve-seo-voi-inertia-js" class="wp-block-heading">2. Hiểu đúng về SEO với Inertia.js</h2>



<p>Inertia.js không phải SPA thuần, mà là:</p>



<ul class="wp-block-list">
<li>Server vẫn trả HTML gốc</li>



<li>Vue render phía client</li>
</ul>



<p>Tuy nhiên:</p>



<ul class="wp-block-list">
<li>Nội dung chính vẫn xuất hiện sau khi JS chạy</li>



<li>SEO <strong>chấp nhận được</strong>, nhưng <strong>chưa tối ưu</strong> nếu không cấu hình thêm</li>
</ul>



<hr class="wp-block-separator has-alpha-channel-opacity"/>



<h2 id="3-thiet-lap-metadata-dong-cuc-ky-quan-trong" class="wp-block-heading">3. Thiết lập metadata động (cực kỳ quan trọng)</h2>



<h3 id="3-1-dung-head-api-cua-inertia" class="wp-block-heading">3.1 Dùng Head API của Inertia</h3>



<pre class="wp-block-code"><code>import { Head } from '@inertiajs/vue3';</code></pre>



<pre class="wp-block-code"><code>&lt;template>
  &lt;Head>
    &lt;title>{{ title }}&lt;/title>
    &lt;meta name="description" :content="description" />
    &lt;meta property="og:title" :content="title" />
    &lt;meta property="og:description" :content="description" />
  &lt;/Head>
&lt;/template></code></pre>



<h3 id="3-2-truyen-du-lieu-tu-laravel-controller" class="wp-block-heading">3.2 Truyền dữ liệu từ Laravel Controller</h3>



<pre class="wp-block-code"><code>return Inertia::render('Post/Show', &#91;
    'title' => $post->title,
    'description' => Str::limit($post->content, 160),
]);</code></pre>



<hr class="wp-block-separator has-alpha-channel-opacity"/>



<h2 id="4-render-html-ban-dau-day-du-hon-preload-data" class="wp-block-heading">4. Render HTML ban đầu đầy đủ hơn (Preload data)</h2>



<h3 id="kich-hoat-ssr-server-side-rendering-cho-inertia" class="wp-block-heading">Kích hoạt SSR (Server Side Rendering) cho Inertia</h3>



<blockquote class="wp-block-quote is-layout-flow wp-block-quote-is-layout-flow">
<p>Đây là bước giúp SEO <strong>nhảy vọt</strong>.</p>
</blockquote>



<h4 id="cai-ssr-tham-khao-chi-tiet-o-phan-1" class="wp-block-heading">Cài SSR (tham khảo chi tiết ở phần 1)</h4>



<pre class="wp-block-code"><code>npm install @inertiajs/server</code></pre>



<pre class="wp-block-code"><code>php artisan inertia:start-ssr</code></pre>



<p>Laravel sẽ:</p>



<ul class="wp-block-list">
<li>Render HTML phía server</li>



<li>Bot Google thấy ngay nội dung</li>
</ul>



<h4 id="loi-ich" class="wp-block-heading">Lợi ích</h4>



<figure class="wp-block-table"><table class="has-fixed-layout"><thead><tr><th>Tiêu chí</th><th>Không SSR</th><th>Có SSR</th></tr></thead><tbody><tr><td>Index</td><td>Chậm</td><td>Nhanh</td></tr><tr><td>Nội dung</td><td>Phụ thuộc JS</td><td>Có sẵn</td></tr><tr><td>SEO score</td><td>Trung bình</td><td>Cao</td></tr></tbody></table></figure>



<hr class="wp-block-separator has-alpha-channel-opacity"/>



<h2 id="5-cau-hinh-nginx-chuan-seo-hieu-nang" class="wp-block-heading">5. Cấu hình Nginx chuẩn SEO + hiệu năng</h2>



<h3 id="5-1-bat-gzip-brotli" class="wp-block-heading">5.1 Bật gzip / brotli</h3>



<pre class="wp-block-code"><code>gzip on;
gzip_types text/plain text/css application/json application/javascript text/xml application/xml application/xml+rss text/javascript;</code></pre>



<h3 id="5-2-cache-static-files" class="wp-block-heading">5.2 Cache static files</h3>



<pre class="wp-block-code"><code>location ~* \.(js|css|png|jpg|jpeg|gif|svg|webp)$ {
    expires 30d;
    access_log off;
}</code></pre>



<h3 id="5-3-http-headers-seo" class="wp-block-heading">5.3 HTTP Headers SEO</h3>



<pre class="wp-block-code"><code>add_header X-Content-Type-Options nosniff;
add_header X-Frame-Options SAMEORIGIN;
add_header X-XSS-Protection "1; mode=block";</code></pre>



<hr class="wp-block-separator has-alpha-channel-opacity"/>



<h2 id="6-docker-toi-uu-cho-seo-ttfb-thap" class="wp-block-heading">6. Docker tối ưu cho SEO (TTFB thấp)</h2>



<h3 id="6-1-su-dung-php-fpm-production" class="wp-block-heading">6.1 Sử dụng PHP-FPM production</h3>



<pre class="wp-block-code"><code>FROM php:8.2-fpm-alpine</code></pre>



<h3 id="6-2-opcache" class="wp-block-heading">6.2 OPcache</h3>



<pre class="wp-block-code"><code>opcache.enable=1
opcache.memory_consumption=256
opcache.max_accelerated_files=20000</code></pre>



<h3 id="6-3-docker-compose-network-noi-bo" class="wp-block-heading">6.3 Docker Compose network nội bộ</h3>



<p>Tránh expose không cần thiết, giảm latency.</p>



<hr class="wp-block-separator has-alpha-channel-opacity"/>



<h2 id="7-sitemap-robots-txt-tu-dong-trong-laravel" class="wp-block-heading">7. Sitemap &amp; robots.txt tự động trong Laravel</h2>



<h3 id="7-1-cai-package" class="wp-block-heading">7.1 Cài package</h3>



<pre class="wp-block-code"><code>composer require spatie/laravel-sitemap</code></pre>



<h3 id="7-2-tao-sitemap" class="wp-block-heading">7.2 Tạo sitemap</h3>



<pre class="wp-block-code"><code>SitemapGenerator::create(config('app.url'))
    ->writeToFile(public_path('sitemap.xml'));</code></pre>



<h3 id="7-3-robots-txt" class="wp-block-heading">7.3 robots.txt</h3>



<pre class="wp-block-code"><code>User-agent: *
Allow: /
Sitemap: https://domain.com/sitemap.xml</code></pre>



<hr class="wp-block-separator has-alpha-channel-opacity"/>



<h2 id="8-schema-org-rich-snippets" class="wp-block-heading">8. Schema.org (Rich snippets)</h2>



<p>Thêm JSON-LD trong Inertia Head:</p>



<pre class="wp-block-code"><code>&lt;script type="application/ld+json">
{
  "@context": "https://schema.org",
  "@type": "Article",
  "headline": "{{ title }}"
}
&lt;/script></code></pre>



<hr class="wp-block-separator has-alpha-channel-opacity"/>



<h2 id="9-kiem-tra-seo" class="wp-block-heading">9. Kiểm tra SEO</h2>



<h3 id="cong-cu-nen-dung" class="wp-block-heading">Công cụ nên dùng</h3>



<ul class="wp-block-list">
<li>Google Search Console</li>



<li>PageSpeed Insights</li>



<li>Lighthouse</li>



<li>Screaming Frog</li>
</ul>



<h3 id="kpi-nen-theo-doi" class="wp-block-heading">KPI nên theo dõi</h3>



<ul class="wp-block-list">
<li>LCP &lt; 2.5s</li>



<li>CLS &lt; 0.1</li>



<li>TTFB &lt; 500ms</li>



<li>Index coverage</li>
</ul>



<hr class="wp-block-separator has-alpha-channel-opacity"/>



<h2 id="10-checklist-nhanh" class="wp-block-heading">10. Checklist nhanh</h2>



<p>✅ Inertia Head metadata</p>



<p>✅ SSR enabled</p>



<p>✅ Gzip + cache static</p>



<p>✅ Sitemap.xml</p>



<p>✅ robots.txt</p>



<p>✅ JSON-LD</p>



<p>✅ Docker optimized</p>



<p>✅ OPcache</p>



<hr class="wp-block-separator has-alpha-channel-opacity"/>



<h2 id="11-ket-luan" class="wp-block-heading">11. Kết luận</h2>



<p>Laravel + Inertia.js + Vue 3 hoàn toàn <strong>SEO tốt</strong> nếu:</p>



<ul class="wp-block-list">
<li>Có SSR</li>



<li>Metadata đúng</li>



<li>Server nhanh</li>



<li>Cấu hình Nginx &amp; Docker chuẩn</li>
</ul>



<blockquote class="wp-block-quote is-layout-flow wp-block-quote-is-layout-flow">
<p>SEO không chỉ là content – mà là <strong>kiến trúc hệ thống</strong>.</p>
</blockquote>



<hr class="wp-block-separator has-alpha-channel-opacity"/>



<p>Nếu bạn đang chạy dự án Laravel Inertia trên Docker và muốn audit SEO chuyên sâu (TTFB, crawlability, SSR setup), bạn có thể mở rộng thêm:</p>



<ul class="wp-block-list">
<li>Redis cache</li>



<li>Full page cache cho bot</li>



<li>Edge caching (Cloudflare)</li>



<li>Prerender.io cho bot</li>
</ul>



<hr class="wp-block-separator has-alpha-channel-opacity"/>



<p>Chúc bạn tối ưu SEO thành công </p>
<p>The post <a href="https://blog.tomosia.com.vn/toi-uu-seo-cho-laravel-inertia-js-voi-vue-3-docker-nginx-phan-2/">Tối ưu SEO cho Laravel Inertia.js với Vue 3 + Docker + Nginx (Phần 2)</a> appeared first on <a href="https://blog.tomosia.com.vn">Tomoshare</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://blog.tomosia.com.vn/toi-uu-seo-cho-laravel-inertia-js-voi-vue-3-docker-nginx-phan-2/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
	</channel>
</rss>
