+  HandyCache форум
|-+  Главная категория» English forum» need some sample hcextension hc_ims
Имя пользователя:
Пароль:
Страниц: [1]   Вниз
  Отправить эту тему    Печать  
Автор Тема: need some sample hcextension hc_ims  (Прочитано 3807 раз)
0 Пользователей и 1 Гость смотрят эту тему.
reges007
Новичок
*

Репутация: +0/-0
Offline Offline

Сообщений: 29


« : 04 января 2013, 17:23:27 »

here my experiment manual IMS cache control with extension

Цитировать
function Request()

  if hc.method == 'GET' then

    ims = hc_ims

      if ims~=nil then
        hc.action = 'dont_update-'
        hc.monitor_string = hc.monitor_string..'ims to don't update '
      end 

  end

end

I'm very confused, need a sample value code when using hc_ims or request_ims
anyone can explain about hc_ims or request_ims in extesion?
Сообщить модератору   Записан
mirny
Пользователь
**

Репутация: +11/-1
Offline Offline

Сообщений: 84


« Ответ #1 : 04 января 2013, 17:37:16 »

Those vars belong to hc table, thus you have to refer to them as hc.hc_ims and hc.request_ims in your code.
Сообщить модератору   Записан
reges007
Новичок
*

Репутация: +0/-0
Offline Offline

Сообщений: 29


« Ответ #2 : 04 января 2013, 18:35:40 »

Those vars belong to hc table, thus you have to refer to them as hc.hc_ims and hc.request_ims in your code.
ok thank's for correction

but still got problem string error

Цитировать

04.01.13 20:08:02,297 # 157: Start connection from client

04.01.13 20:08:02,297 # 157: Connection from 127.0.0.1:3163 to HC Version 1.00 RC3 (1.0.0.408)

04.01.13 20:08:02,297 # 157: User name: local

04.01.13 20:08:02,297 # 157 <<< URL: http://giantmug.com/jengchein/Popcap/Popcap%20Alchemy%20Deluxe.exe
BRHS-SCRIPT "Request" ERROR:
[string "?"]:20: '=' expected near 'update'
Сообщить модератору   Записан
mirny
Пользователь
**

Репутация: +11/-1
Offline Offline

Сообщений: 84


« Ответ #3 : 04 января 2013, 18:49:43 »

Quotes are messed up. Try this replacement:
'ims to don't update ' -> [[ims to don't update ]]
or this:
'ims to don't update ' -> 'ims to don\'t update '

Why don't you look up the Lua reference, btw?
Сообщить модератору   Записан
reges007
Новичок
*

Репутация: +0/-0
Offline Offline

Сообщений: 29


« Ответ #4 : 04 января 2013, 20:00:58 »

Why don't you look up the Lua reference, btw?

sorry sir for my mistake not yet completly read Lua reference


ok problem solved for my custome rule ims

Цитировать
function Request()

  if hc.method == 'GET' then

   ims = hc.hc_ims

      if ims~=nil then
        hc.action = 'dont_update-'
        hc.monitor_string = hc.monitor_string..'ims to don\'t update'
      end 

  end
end
Сообщить модератору   Записан
reges007
Новичок
*

Репутация: +0/-0
Offline Offline

Сообщений: 29


« Ответ #5 : 05 января 2013, 06:13:25 »

one more question Веселый

how to replace rule HC-IMS to hc.action = 'dont_update-' ?

Posted on: 05 January 2013, 06:04:37

or anyone known about command hc.hc_ims and hc.request_ims reference?



* ims.JPG (18.81 Кб, 503x128 - просмотрено 195 раз.)
Сообщить модератору   Записан
Страниц: [1]   Вверх
  Отправить эту тему    Печать  

 
Перейти в: