在Azure Kubernetes环境部署的Sitecore网站中,我们遇到了一个棘手的静态资源缓存问题。尽管CSS和JS文件能被CDN正常缓存(返回TCP_HIT),但HTML文件始终返回TCP_MISS,导致性能下降和不必要的带宽消耗。
经过初步检查,我们发现CSS和HTML的响应头竟然完全相同:
# CSS响应头
HTTP/1.1 200 OK
Cache-Control: public, no-cache="Set-Cookie", max-age=31536000
Content-Type: text/css
Set-Cookie: website#lang=en; path=/; secure; SameSite=None
Set-Cookie: shell#lang=en; path=/; secure; SameSite=None
X-Static-CacheControl: true
...
# HTML响应头
HTTP/1.1 200 OK
Cache-Control: public, no-cache="Set-Cookie", max-age=86400
Content-Type: text/html
Set-Cookie: website#lang=en; path=/; secure; SameSite=None
Set-Cookie: shell#lang=en; path=/; secure; SameSite=None
X-Static-CacheControl: true
...
Sitecore 10.4
In Sitecore environments with large content databases and multiple publishing targets, publishing operations can sometimes take a very long time to complete. When a publishing job gets stuck or needs to be stopped for any reason, the standard approach has often been to restart the Content Management (CM) server - a disruptive and inefficient solution.
While Sitecore PowerShell Extensions (SPE) provides functionality to view and cancel queued publishing jobs, it doesn't offer a built-in way to terminate jobs that are already running. This post presents a comprehensive solution for safely terminating running publish jobs in Sitecore without restarting the server.
Before diving into the solution, it's important to understand the key components of Sitecore's publishing architecture:
https://github.com/yinxin630/fiora
https://github.com/yinxin630/fiora/blob/master/docker-compose.yaml
https://yinxin630.github.io/fiora/zh-Hans/docs/install#docker-%E8%BF%90%E8%A1%8C
docker-compose.yml 文件
services:
mongodb:
image: mongo
container_name: fiora_db
volumes:
- ${PWD}/data/mongo:/data/db
restart: always
redis:
image: redis
container_name: fiora_redis
volumes:
- ${PWD}/data/redis:/data
restart: always
fiora:
image: suisuijiang/fiora
container_name: fiora
ports:
- "127.0.0.1:9200:9200"
environment:
- Database=mongodb://mongodb:27017/fiora
- RedisHost=redis
- Administrator=admin
- DisableCreateGroup=true
depends_on:
- mongodb
- redis
restart: always
Lsky Pro 是一款开源的图床程序,支持多种存储方式,提供了良好的用户界面和丰富的功能。本文将详细介绍如何使用 Docker Compose 来部署 Lsky Pro,这种方式相比传统安装更加简单和可维护。
https://docs.lsky.pro/guide/install
https://www.cpolar.com/blog/casaos-uses-docker-to-build-lsky-pro-locally
https://hub.docker.com/r/dko0/lsky-pro
https://blog.laoda.de/archives/docker-compose-install-lskypro
https://github.com/lsky-org/lsky-pro/issues/256
mkdir lsky-pro
cd lsky-pro
Waline是一个简洁、安全的评论系统,支持多种部署方式。本文将介绍如何使用Docker独立部署Waline,并配置MySQL数据库来存储评论数据。通过Docker部署不仅简化了安装过程,还提供了更好的环境隔离和可移植性。
https://waline.js.org/guide/database.html
https://bg3lnt.xyz/posts/dc23e930.html
在开始部署之前,请确保您的系统满足以下要求:
在Sitecore内容管理中,经常会遇到需要批量创建多个相同模板项的情况。默认的Sitecore只支持一次创建一个项,这对于需要创建多个类似项(如卡片、图片等)的场景来说效率较低。本文将介绍如何扩展Sitecore的插入功能,实现一次性创建多个项的功能。
https://stackoverflow.com/a/55615885
https://community.chocolatey.org/packages/redis
https://redis.io/docs/latest/operate/oss_and_stack/install/install-redis/install-redis-on-windows/
在复杂的云原生环境中,确保各组件间的连接至关重要。本文将分享一个在Azure Kubernetes Service (AKS) 的Windows容器中测试Redis SSL连接的曲折历程,最终找到了一个出人意料的简单解决方案。
我们的项目是一个基于ASP.NET的Sitecore应用,部署在Azure Kubernetes Service的Windows容器中。整个系统包含多个组件:
在将 Sitecore 数据库从生产环境迁移到非生产环境后,xdbautomationworker 容器出现了无法连接到 SQL Server 的问题。错误日志显示:
System.Data.SqlClient.SqlException (0x80131904): Only active directory users can impersonate other active directory users.
这个错误发生在尝试执行 Sitecore.Xdb.ReferenceData.SqlServer.Commands.GetDefinitionTypeCommand
时。
我们进行了以下调查:
检查数据库所有者:
SELECT name , owner_sid
FROM sys.databases
在本文中,我们将详细介绍如何在Debian 12服务器上配置Nginx,设置Cloudflare CDN,以及为需要直接访问源站的特殊程序申请SSL证书。这个过程涉及多个步骤,包括安装Nginx,配置域名,使用Cloudflare CDN,以及使用Certbot申请SSL证书。
https://certbot-dns-cloudflare.readthedocs.io/en/stable/
https://lucasc.me/post/howto-certbot-dns-cloudflare-in-webmin
首先,我们在Debian 12服务器上安装Nginx:
sudo apt update
sudo apt install nginx
安装完成后,配置您的域名。编辑Nginx配置文件,通常位于/etc/nginx/sites-available/
目录下。
接下来,我们使用Cloudflare CDN来提高网站性能和安全性:
https://sitecore.stackexchange.com/questions/23840/xdb-collection-shard0-login-failed-for-user
When performing database migrations in a Sitecore environment, particularly when copying from a production environment to a non-production environment, one may encounter several tricky issues. Recently, we faced an interesting case involving the Sitecore XDB container’s inability to connect after the database migration. This article will share our troubleshooting process and the final solution.
After copying the production database to the non-production environment, the Sitecore XDB container began reporting connection errors. The error message indicated:
Database 'Sitecore.Xdb.Collection.Shard0' on server 'ahke-non-prod-sql1' is not currently available.
https://sitecore.stackexchange.com/questions/23840/xdb-collection-shard0-login-failed-for-user
在 Sitecore 环境中进行数据库迁移时,特别是从生产环境复制到非生产环境时,可能会遇到一些棘手的问题。最近,我们遇到了一个有趣的案例,涉及 Sitecore XDB 容器在数据库迁移后无法连接的问题。本文将分享我们的故障排除过程和最终解决方案。
在将生产数据库复制到非生产环境后,Sitecore XDB 容器开始报告连接错误。错误信息显示:
Database 'Sitecore.Xdb.Collection.Shard0' on server 'ahke-non-prod-sql1' is not currently available.