+  HandyCache форум
|-+  Главная категория» English forum» Only from cache ?
Имя пользователя:
Пароль:
Страниц: [1]   Вниз
  Отправить эту тему    Печать  
Автор Тема: Only from cache ?  (Прочитано 8299 раз)
0 Пользователей и 1 Гость смотрят эту тему.
Bicky
Новичок
*

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

Сообщений: 21


« : 18 апреля 2010, 06:30:47 »

Hi,

I see the rule "Only from Cache".

There is a rule :
Код:
#4#~#True#~#\.(bmp|gif|i[mp]g|jpe?g|png|svgz?|swf|tiff?|wmf)(\?|$)#~##~#

But what is the point of that, the result will be that files that are not in cache are not shown or loaded ?

There are rules "Save to Cache" and "Don't Update" for these, so what's the point of having "Only from Cache",
the result is that no image files will get cached, and HC will return a "File not Found" for every image that is not already in the cache ?  Шокирован
Сообщить модератору   Записан
DenZzz
Модератор
*****

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

Сообщений: 5589



« Ответ #1 : 18 апреля 2010, 17:16:18 »

There are rules "Save to Cache" and "Don't Update" for these, so what's the point of having "Only from Cache"

"Only from Cache" works like the option "Cached images only" at Opera or the extension "Images like Opera" at FireFox. Only images that have been previously saved in your proxy's cache can be displayed when "Only from Cache" rules are active. This saves a good amount of page load time and your Internet traffic.

It's useful, for example, when you wanna read only messages on some forums. The skin images, background, interface buttons, smiles, etc. will be taken from the cache, but the new user's attached images will be blocked. This saves a page load time and your Internet traffic.
Сообщить модератору   Записан
Bicky
Новичок
*

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

Сообщений: 21


« Ответ #2 : 18 апреля 2010, 23:08:20 »

Thanks a lot DenZzzz,

I understand now. Улыбка
Сообщить модератору   Записан
truefriend-cz
Постоялец
***

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

Сообщений: 118


« Ответ #3 : 25 декабря 2012, 05:35:04 »

Can I use extensions to create a condition as:

if file not found in cache then load from internet?
Сообщить модератору   Записан
DenZzz
Модератор
*****

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

Сообщений: 5589



« Ответ #4 : 25 декабря 2012, 14:34:15 »

This is default behavior of "Don't Update" list.
In extension:
   hc.action = 'dont_update'
Сообщить модератору   Записан
truefriend-cz
Постоялец
***

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

Сообщений: 118


« Ответ #5 : 25 декабря 2012, 16:20:13 »

I have "Only for cache" for all.
Somewhere is a mistake. I thought the extensions has a higher priority over all.
I will use
Код:
--[[ <HCExtension>
@name         Test
@event        BeforeRequestHeaderSend/Request
</HCExtension> ]]

function Request()
hc.action = 'dont_update'
end

but the page appears:

Not found
HandyCache: File http://blabla.bla/bla/bla.html not found in cache.
« Последнее редактирование: 25 декабря 2012, 16:35:54 от truefriendcz » Сообщить модератору   Записан
DenZzz
Модератор
*****

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

Сообщений: 5589



« Ответ #6 : 25 декабря 2012, 17:27:51 »

No, you must disable "Only for cache" list first.
Сообщить модератору   Записан
truefriend-cz
Постоялец
***

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

Сообщений: 118


« Ответ #7 : 25 декабря 2012, 17:30:04 »

No, you must disable "Only for cache" list first.
Ok. Плачущий it is annoying that Extensions can not override all settings completely. It would be possible to include in the future plan of this change?
Сообщить модератору   Записан
DenZzz
Модератор
*****

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

Сообщений: 5589



« Ответ #8 : 25 декабря 2012, 17:44:49 »

You can disable "Only for cache" list directly from the extension for the current request. Use hc.white_mask variable.
Добавлено: 25 Декабрь 2012, 17:31:13

Код:
--[[ <HCExtension>
@name         Test
@event        BeforeViewInMonitor
@event        BeforeRequestHeaderSend/Request
</HCExtension> ]]

function BeforeViewInMonitor()
hc.white_mask = 'O'
end

function Request()
hc.action = 'dont_update'
end

Добавлено: 25 Декабрь 2012, 17:39:08

OR like this:
 
Код:
--[[ <HCExtension>
@name         Test
@event        RequestHeaderReceived
</HCExtension> ]]

function RequestHeaderReceived()
hc.white_mask = 'O'
hc.action = 'dont_update'
end
Сообщить модератору   Записан
truefriend-cz
Постоялец
***

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

Сообщений: 118


« Ответ #9 : 25 декабря 2012, 17:56:12 »

I have HC based on White List and other lists only enable with one rule (.*)
My white list in attachment

* white.lst (4.47 Кб - загружено 100 раз.)
Сообщить модератору   Записан
DenZzz
Модератор
*****

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

Сообщений: 5589



« Ответ #10 : 26 декабря 2012, 15:08:13 »

I don't know for what purpose you want to use the extension.
If you want: "if file not found in cache then load from internet", simply disable "Only for cache" list from your "White" list. And your rule (.*) in "White" list do this. What's the problem?
Сообщить модератору   Записан
Страниц: [1]   Вверх
  Отправить эту тему    Печать  

 
Перейти в: