x11 Posted June 5, 2020 Share Posted June 5, 2020 На десктопных браузерах все достаточно просто. Если браузер что-то кэширует у себя, то: Ctrl+F5 - для Firefox. Shift+F5 - для Chrome. И страница в браузере уже новой версии. Но на смартфоне нет возможности нажать такие клавиши. Иногда или даже часто приходится открывать настройки/параметры браузера и очищать данные (кэш). Что-то поменял в программе, перекомпилировал программу, изменил CSS и приходится открывать настройки/параметры браузера и очищать данные/кэш иначе загружается старая страница веб-приложения. Особенно это касается, если что-то меняешь в CSS (CustomCSS). Может быть можно дать понять браузеру, дать какой-то "сигнал" или "ключ", или "параметр", что данные кэшировать не нужно. Т.е. как на стадии разработки кэширование полностью отключить, включая и сам браузер? Спасибо. Quote Link to comment Share on other sites More sharing options...
stas Posted June 11, 2020 Share Posted June 11, 2020 Загружайте css самостоятельно, с параметром Касательно customcss не уверен что он не обновляется Quote Link to comment Share on other sites More sharing options...
x11 Posted June 12, 2020 Author Share Posted June 12, 2020 14 hours ago, stas said: Загружайте css самостоятельно, с параметром не понял 14 hours ago, stas said: Касательно customcss не уверен что он не обновляется в том-то и дело... Quote Link to comment Share on other sites More sharing options...
Sherzod Posted June 12, 2020 Share Posted June 12, 2020 Здравствуйте, 25 minutes ago, x11 said: 14 hours ago, stas said: Загружайте css самостоятельно, с параметром не понял В секции инициализации модуля можете использовать такой код: initialization UniAddLazyLoader('/yourFolder/yourCSSFile.css?' + FormatDateTime('ddmmyyyyhhmmss', Now) , [upoFolderFiles, upoPlatformDesktop]); Quote Link to comment Share on other sites More sharing options...
x11 Posted June 12, 2020 Author Share Posted June 12, 2020 У меня сейчас один общий CSS для проекта, который загружается в секции инициализации серверного модуля: UniAddCSSLibrary('css/custommob.css', False, [upoFolderFiles, upoPlatformMobile]); Потому что те или иные визуальные компоненты по всему проекту, в разных формах, но они должны выглядеть одинаково. Т.е. чтобы не дублировать по 5-10 раз одно и то же, вот, например, вот такое: .x-input-wrap-el { border-radius: 5px; } И теперь вы предлагаете дублировать этот код в каждой отдельной форме, я правильно понимаю? Quote Link to comment Share on other sites More sharing options...
Sherzod Posted June 12, 2020 Share Posted June 12, 2020 10 minutes ago, x11 said: И теперь вы предлагаете дублировать этот код в каждой отдельной форме, я правильно понимаю? Нет. По крайней мере, Вы можете переместить в MainForm. Quote Link to comment Share on other sites More sharing options...
x11 Posted June 12, 2020 Author Share Posted June 12, 2020 Хотелось бы почитать про UniAddLazyLoader, но информации нету Quote Link to comment Share on other sites More sharing options...
x11 Posted June 12, 2020 Author Share Posted June 12, 2020 1 hour ago, Sherzod said: По крайней мере, Вы можете переместить в MainForm. Не до конца понял. Переместить загрузку custom css именно с помощью UniAddLazyLoader()? Или переместить UniAddCSSLibrary() из серверного модуля в MainForm? А может можно переместить загрузку в UniMainModule? Quote Link to comment Share on other sites More sharing options...
Sherzod Posted June 12, 2020 Share Posted June 12, 2020 2 minutes ago, x11 said: Или переместить UniAddCSSLibrary() из серверного модуля в MainForm? А может можно переместить загрузку в UniMainModule? Да, Вы можете попробовать. Quote Link to comment Share on other sites More sharing options...
x11 Posted June 12, 2020 Author Share Posted June 12, 2020 Перенес в UniMainModule UniAddCSSLibrary('css/custommob.css', False, [upoFolderFiles, upoPlatformMobile]); не помогает Quote Link to comment Share on other sites More sharing options...
x11 Posted June 12, 2020 Author Share Posted June 12, 2020 заменил UniAddCSSLibrary на UniAddLazyLoader('css/custommob.css?' + FormatDateTime('ddmmyyyyhhmmss', Now) , [upoFolderFiles, upoPlatformMobile]); теперь вообще custommob.css не загружается Quote Link to comment Share on other sites More sharing options...
Sherzod Posted June 12, 2020 Share Posted June 12, 2020 12 minutes ago, x11 said: теперь вообще custommob.css не загружается Я проверю. Quote Link to comment Share on other sites More sharing options...
Sherzod Posted June 12, 2020 Share Posted June 12, 2020 1 hour ago, Sherzod said: из серверного модуля в MainForm? Это нормально для Вас!? Quote Link to comment Share on other sites More sharing options...
Sherzod Posted June 12, 2020 Share Posted June 12, 2020 1 hour ago, Sherzod said: из серверного модуля в MainForm Попробуйте этот код на данный момент: procedure TMainmForm.UnimFormCreate(Sender: TObject); begin UniSession.AddJS('Ext.Loader.loadScript("/files/css/custommob.css")'); ... end; Quote Link to comment Share on other sites More sharing options...
x11 Posted June 12, 2020 Author Share Posted June 12, 2020 а как быть, если есть форма логина? Quote Link to comment Share on other sites More sharing options...
Sherzod Posted June 12, 2020 Share Posted June 12, 2020 procedure TUniMainModule.UniGUIMainModuleBeforeLogin(Sender: TObject; var Handled: Boolean); begin UniSession.AddJS('Ext.Loader.loadScript("/files/css/custommob.css")'); end; 1 Quote Link to comment Share on other sites More sharing options...
x11 Posted June 12, 2020 Author Share Posted June 12, 2020 Спасибо, вроде рабаотает без очистки кэша. 1 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.