apache_conf Miva - 使用瞬态模块缓存整个商店

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了apache_conf Miva - 使用瞬态模块缓存整个商店相关的知识,希望对你有一定的参考价值。

<mvt:assign name="g.Transient_Code" value="'Screen__' $ g.Proxy_Screen" />
<mvt:if expr="g.Secure">
	<mvt:assign name="g.Call_URL" value="g.domain:mm_surl $ 'Screen=' $ g.Proxy_Screen" />
<mvt:else>
	<mvt:assign name="g.Call_URL" value="g.domain:mm_url $ 'Screen=' $ g.Proxy_Screen" />
</mvt:if>

<mvt:if expr="g.Proxy_Screen EQ 'CTGY' ">
	<mvt:assign name="g.Transient_Code" value="g.Transient_Code $ '--' $ g.Category_Code" />
	<mvt:assign name="g.Call_URL" value="g.Call_URL $ '&Category_Code=' $ g.Category_Code" />
<mvt:elseif expr="g.Proxy_Screen EQ 'PROD' ">
	<mvt:assign name="g.Transient_Code" value="g.Transient_Code $ '--' $ g.Product_Code" />
	<mvt:assign name="g.Call_URL" value="g.Call_URL $ '&Product_Code=' $ g.Product_Code" />
</mvt:if>

<mvt:do file="g.Module_Root $ '/modules/util/transients.mvc'" name="l.settings:transient_data" value="Get_Transient( g.Transient_Code )" />

<mvt:if expr="l.settings:transient_data EQ 0">
	<mvt:assign name="l.settings:transient_data" value="''" />

	<mvt:call action="g.Call_URL" method="'GET'">
		<mvt:assign name="l.settings:transient_data" value="l.settings:transient_data $ s.callvalue" />
	</mvt:call>

	<mvt:assign name="l.settings:transient_data" value="l.settings:transient_data $ '<!-- !@! Served from Transient Cache | ' $ g.Call_URL $ ' | Cached on ' $ s.dyn_stm_wday $ ' ' $ s.dyn_stm_mon $ ' ' $ s.dyn_tm_mday $ ', ' $ s.dyn_tm_year $ ' ' $ s.dyn_tm_hour $ ':' $ s.dyn_tm_min $ ':' $ s.dyn_tm_sec $ ' ' $ s.dyn_stm_zone $ ' -->'" />

	<mvt:do file="g.Module_Root $ '/modules/util/transients.mvc'" name="l.set_transient" value="Set_Transient( g.Transient_Code, trim(l.settings:transient_data), 60*60*24)" />
</mvt:if>

&mvt:transient_data;
# Miva - Use Transient Module to Cache Entire Store (prototype)
The following code is a basic prototype of how the main landing pages could be cached using the [Transient module](http://apps.miva.com/transients.html) and some .htaccess rules.

So far it only would work well with Miva's Long Merchant URLs or the Legacy SEO Short Link structure. I haven't tried finding a way to get it to work with URI Management yet.

This implimentation is not complete, and would require some other updates:

- Remove Session IDs from the cached HTML
- Use to AJAX load in mini-basket & account info
- Needs to account for query string parameters, POST's, and other more intricate web-requests
- Add a way for store-owner to purge the cache manually.
- Test this thouroughly!
# Product Pages
RewriteCond %{REQUEST_FILENAME} !-s
RewriteRule ^p/([^/.]+)$ /mm5/merchant.mvc?Screen=cache_layer&Proxy_Screen=PROD&Product_Code=$1 [L,NC]

# Category pages
RewriteCond %{REQUEST_FILENAME} !-s
RewriteRule ^c/([^/.]+)$ /mm5/merchant.mvc?Screen=cache_layer&Proxy_Screen=CTGY&Category_Code=$1 [L,NC]

# Static Pages
RewriteCond %{REQUEST_FILENAME} !-s
RewriteRule ^cs/([^/.]+)$ /mm5/merchant.mvc?Screen=cache_layer&Proxy_Screen=$1 [L,NC]

# Home page
RewriteCond %{REQUEST_FILENAME} !-s
RewriteRule ^$ /mm5/merchant.mvc?Screen=cache_layer&Proxy_Screen=SFNT [L,NC]

以上是关于apache_conf Miva - 使用瞬态模块缓存整个商店的主要内容,如果未能解决你的问题,请参考以下文章

apache_conf Miva - 在顶级域上启用查询字符串

xml SD4 Miva9更改==如果他们没有使用MIVA9优惠券,请删除优惠券==

xml SD4 Miva9更改==如果他们没有使用MIVA9优惠券,请删除优惠券==

xml Miva - 使用mvt:do生成RMA

html 使用客户的实际Miva定价更新SearchSpring结果

html Miva - 使用购物篮自定义字段预览功能