无法使用Boost / Drupal 7缓存首页

时间:2021-06-04 21:11:49

I've already configure my Drupal site with Boost.

我已经使用Boost配置了我的Drupal站点。

I have tested and everything works but the front page.

我已经测试过,一切正常但是头版。

Front page gets cached, but it's being regenerated every pageload.

首页被缓存,但每个页面加载都会重新生成。

In Boost configurations I set to cache only listed pages and included two options for this purpose: inicio

在Boost配置中,我设置为仅缓存列出的页面,并为此包含两个选项:inicio

Inicio is a view, which is my frontpage too.

Inicio是一个视图,也是我的首页。

I want a solution, or a workaround. I don't know how to write .htaccess files. If I would know how to do this I will serve the frontpage with my own rule, in case this page exists... or something like that.

我想要一个解决方案或解决方法。我不知道怎么写.htaccess文件。如果我知道如何做到这一点,我会用我自己的规则服务于首页,以防这个页面存在......或类似的东西。

Thanks for your help.

谢谢你的帮助。

1 个解决方案

#1


Finally! The answer is this:

最后!答案是这样的:

# Special handling for front page for Apache 2.4
# RewriteCond %{REQUEST_URI} ^/index\.php$
# RewriteCond %{DOCUMENT_ROOT}/cache/%{ENV:boostpath}/%{HTTP_HOST}/\_%{QUERY_STRING}\.html -s
# RewriteRule .* cache/%{ENV:boostpath}/%{HTTP_HOST}/\_%{QUERY_STRING}\.html [L,T=text/html]

You can put this before the .htaccess generated by Boost. Explanations? Here is explained in detail and also the solution: https://www.drupal.org/node/2078595#comment-7885027

你可以把它放在Boost生成的.htaccess之前。解释吗?这里有详细解释和解决方案:https://www.drupal.org/node/2078595#comment-7885027

#1


Finally! The answer is this:

最后!答案是这样的:

# Special handling for front page for Apache 2.4
# RewriteCond %{REQUEST_URI} ^/index\.php$
# RewriteCond %{DOCUMENT_ROOT}/cache/%{ENV:boostpath}/%{HTTP_HOST}/\_%{QUERY_STRING}\.html -s
# RewriteRule .* cache/%{ENV:boostpath}/%{HTTP_HOST}/\_%{QUERY_STRING}\.html [L,T=text/html]

You can put this before the .htaccess generated by Boost. Explanations? Here is explained in detail and also the solution: https://www.drupal.org/node/2078595#comment-7885027

你可以把它放在Boost生成的.htaccess之前。解释吗?这里有详细解释和解决方案:https://www.drupal.org/node/2078595#comment-7885027