prevent usage of cached qooxdoo app script if a new version is deployed

classic Classic list List threaded Threaded
17 messages Options
Reply | Threaded
Open this post in threaded view
|

prevent usage of cached qooxdoo app script if a new version is deployed

Dietrich Streifert
Hi all!

I'm trying to avoid caching of the build script by adding a parameter to
the app script tag like this:

   <script type="text/javascript" src="script/app.js?20130117"></script>

Is there any solution to automate this (eg. based on svn revision, git
commit) via the generator?

Any help would be great.

Regards
Dietrich



------------------------------------------------------------------------------
Master Visual Studio, SharePoint, SQL, ASP.NET, C# 2012, HTML5, CSS,
MVC, Windows 8 Apps, JavaScript and much more. Keep your skills current
with LearnDevNow - 3,200 step-by-step video tutorials by Microsoft
MVPs and experts. ON SALE this month only -- learn more at:
http://p.sf.net/sfu/learnmore_122712
_______________________________________________
qooxdoo-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel
Reply | Threaded
Open this post in threaded view
|

Re: prevent usage of cached qooxdoo app script if a new version is deployed

Dietrich Streifert
Am 17.01.2013 09:37, schrieb Dietrich Streifert:
>
>   <script type="text/javascript" src="script/app.js?20130117"></script>
>
This of course should be:

     <script type="text/javascript"
src="script/app.js?version=20130117"></script>

or

     <script type="text/javascript" src="script/app_20130117.js"></script>


where the second solution would be best in order to avoid caching by
proxies.




------------------------------------------------------------------------------
Master Visual Studio, SharePoint, SQL, ASP.NET, C# 2012, HTML5, CSS,
MVC, Windows 8 Apps, JavaScript and much more. Keep your skills current
with LearnDevNow - 3,200 step-by-step video tutorials by Microsoft
MVPs and experts. ON SALE this month only -- learn more at:
http://p.sf.net/sfu/learnmore_122712
_______________________________________________
qooxdoo-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel
Reply | Threaded
Open this post in threaded view
|

Re: prevent usage of cached qooxdoo app script if a new version is deployed

marginal
There is another solution. Depending on yours HTTP server you may send header "Cache-Control: no-cache" using special settings.
For apache you may use this directives in .htaccess file:

<filesMatch ".(js|css)$">
FileETag None
<ifModule mod_headers.c>
Header set Pragma "no-cache"
</ifModule>
</filesMatch>

If you'r using IIS create Web.config with following settings in system.webServer section:

<httpProtocol>
<customHeaders>
<add name="Cache-Control" value="no-cache" />
</customHeaders>
</httpProtocol>


2013/1/17 Dietrich Streifert <[hidden email]>
Am 17.01.2013 09:37, schrieb Dietrich Streifert:
>
>   <script type="text/javascript" src="script/app.js?20130117"></script>
>
This of course should be:

     <script type="text/javascript"
src="script/app.js?version=20130117"></script>

or

     <script type="text/javascript" src="script/app_20130117.js"></script>


where the second solution would be best in order to avoid caching by
proxies.




------------------------------------------------------------------------------
Master Visual Studio, SharePoint, SQL, ASP.NET, C# 2012, HTML5, CSS,
MVC, Windows 8 Apps, JavaScript and much more. Keep your skills current
with LearnDevNow - 3,200 step-by-step video tutorials by Microsoft
MVPs and experts. ON SALE this month only -- learn more at:
http://p.sf.net/sfu/learnmore_122712
_______________________________________________
qooxdoo-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel



--
когда я опустился на самое дно, снизу мне постучали..

------------------------------------------------------------------------------
Master Visual Studio, SharePoint, SQL, ASP.NET, C# 2012, HTML5, CSS,
MVC, Windows 8 Apps, JavaScript and much more. Keep your skills current
with LearnDevNow - 3,200 step-by-step video tutorials by Microsoft
MVPs and experts. ON SALE this month only -- learn more at:
http://p.sf.net/sfu/learnmore_122712
_______________________________________________
qooxdoo-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel
Reply | Threaded
Open this post in threaded view
|

Re: prevent usage of cached qooxdoo app script if a new version is deployed

Dietrich Streifert
Hi Alexander!

Thank you for your answer.

I'm running on apache so this may be a part of the solutions I'm
searching for.

I WANT the app.js to be cached UNTIL the file version changes.

The html file (index.html) which loads app.js already has in <head>:

   <meta http-equiv="Expires" content="0">
   <meta http-equiv="cache-control" content="no-cache">
   <meta http-equiv="Pragma" content="no-cache">

which is I think equivalent to using mod_headers with: Header set Pragma
"no-cache" and should therefore never get cached by the browser (or am I
wrong here?).

So opening index.html should reliably indicate to the browser if the url
of the script tag changed which should cause an uncached load.



Am 17.01.2013 10:40, schrieb Alexander Voronin:

> There is another solution. Depending on yours HTTP server you may send
> header "Cache-Control: no-cache" using special settings.
> For apache you may use this directives in .htaccess file:
>
> <filesMatch ".(js|css)$">
> FileETag None
> <ifModule mod_headers.c>
> Header set Pragma "no-cache"
> </ifModule>
> </filesMatch>
>
> If you'r using IIS create Web.config with following settings
> in system.webServer section:
>
> <httpProtocol>
> <customHeaders>
> <add name="Cache-Control" value="no-cache" />
> </customHeaders>
> </httpProtocol>
>


------------------------------------------------------------------------------
Master Visual Studio, SharePoint, SQL, ASP.NET, C# 2012, HTML5, CSS,
MVC, Windows 8 Apps, JavaScript and much more. Keep your skills current
with LearnDevNow - 3,200 step-by-step video tutorials by Microsoft
MVPs and experts. ON SALE this month only -- learn more at:
http://p.sf.net/sfu/learnmore_122712
_______________________________________________
qooxdoo-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel
Reply | Threaded
Open this post in threaded view
|

Re: prevent usage of cached qooxdoo app script if a new version is deployed

marginal
This should work. Also pay attention on bug in last Safari for 6.x iOS - for some strange reason it caches even POST requests, so I had to add this headers for whole my mobile solution.


2013/1/17 Dietrich Streifert <[hidden email]>
Hi Alexander!

Thank you for your answer.

I'm running on apache so this may be a part of the solutions I'm
searching for.

I WANT the app.js to be cached UNTIL the file version changes.

The html file (index.html) which loads app.js already has in <head>:

   <meta http-equiv="Expires" content="0">
   <meta http-equiv="cache-control" content="no-cache">
   <meta http-equiv="Pragma" content="no-cache">

which is I think equivalent to using mod_headers with: Header set Pragma
"no-cache" and should therefore never get cached by the browser (or am I
wrong here?).

So opening index.html should reliably indicate to the browser if the url
of the script tag changed which should cause an uncached load.



Am 17.01.2013 10:40, schrieb Alexander Voronin:
> There is another solution. Depending on yours HTTP server you may send
> header "Cache-Control: no-cache" using special settings.
> For apache you may use this directives in .htaccess file:
>
> <filesMatch ".(js|css)$">
> FileETag None
> <ifModule mod_headers.c>
> Header set Pragma "no-cache"
> </ifModule>
> </filesMatch>
>
> If you'r using IIS create Web.config with following settings
> in system.webServer section:
>
> <httpProtocol>
> <customHeaders>
> <add name="Cache-Control" value="no-cache" />
> </customHeaders>
> </httpProtocol>
>


------------------------------------------------------------------------------
Master Visual Studio, SharePoint, SQL, ASP.NET, C# 2012, HTML5, CSS,
MVC, Windows 8 Apps, JavaScript and much more. Keep your skills current
with LearnDevNow - 3,200 step-by-step video tutorials by Microsoft
MVPs and experts. ON SALE this month only -- learn more at:
http://p.sf.net/sfu/learnmore_122712
_______________________________________________
qooxdoo-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel



--
когда я опустился на самое дно, снизу мне постучали..

------------------------------------------------------------------------------
Master Visual Studio, SharePoint, SQL, ASP.NET, C# 2012, HTML5, CSS,
MVC, Windows 8 Apps, JavaScript and much more. Keep your skills current
with LearnDevNow - 3,200 step-by-step video tutorials by Microsoft
MVPs and experts. ON SALE this month only -- learn more at:
http://p.sf.net/sfu/learnmore_122712
_______________________________________________
qooxdoo-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel
Reply | Threaded
Open this post in threaded view
|

Re: prevent usage of cached qooxdoo app script if a new version is deployed

marginal
Oh, sorry! This should NOT work. You'r setting this pragmas for HTML page but not for javascript, which is loading by SEPARATE request! So HTML will not be cached, but javascritp will!


2013/1/17 Alexander Voronin <[hidden email]>
This should work. Also pay attention on bug in last Safari for 6.x iOS - for some strange reason it caches even POST requests, so I had to add this headers for whole my mobile solution.


2013/1/17 Dietrich Streifert <[hidden email]>
Hi Alexander!

Thank you for your answer.

I'm running on apache so this may be a part of the solutions I'm
searching for.

I WANT the app.js to be cached UNTIL the file version changes.

The html file (index.html) which loads app.js already has in <head>:

   <meta http-equiv="Expires" content="0">
   <meta http-equiv="cache-control" content="no-cache">
   <meta http-equiv="Pragma" content="no-cache">

which is I think equivalent to using mod_headers with: Header set Pragma
"no-cache" and should therefore never get cached by the browser (or am I
wrong here?).

So opening index.html should reliably indicate to the browser if the url
of the script tag changed which should cause an uncached load.



Am 17.01.2013 10:40, schrieb Alexander Voronin:
> There is another solution. Depending on yours HTTP server you may send
> header "Cache-Control: no-cache" using special settings.
> For apache you may use this directives in .htaccess file:
>
> <filesMatch ".(js|css)$">
> FileETag None
> <ifModule mod_headers.c>
> Header set Pragma "no-cache"
> </ifModule>
> </filesMatch>
>
> If you'r using IIS create Web.config with following settings
> in system.webServer section:
>
> <httpProtocol>
> <customHeaders>
> <add name="Cache-Control" value="no-cache" />
> </customHeaders>
> </httpProtocol>
>


------------------------------------------------------------------------------
Master Visual Studio, SharePoint, SQL, ASP.NET, C# 2012, HTML5, CSS,
MVC, Windows 8 Apps, JavaScript and much more. Keep your skills current
with LearnDevNow - 3,200 step-by-step video tutorials by Microsoft
MVPs and experts. ON SALE this month only -- learn more at:
http://p.sf.net/sfu/learnmore_122712
_______________________________________________
qooxdoo-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel



--
когда я опустился на самое дно, снизу мне постучали..



--
когда я опустился на самое дно, снизу мне постучали..

------------------------------------------------------------------------------
Master Visual Studio, SharePoint, SQL, ASP.NET, C# 2012, HTML5, CSS,
MVC, Windows 8 Apps, JavaScript and much more. Keep your skills current
with LearnDevNow - 3,200 step-by-step video tutorials by Microsoft
MVPs and experts. ON SALE this month only -- learn more at:
http://p.sf.net/sfu/learnmore_122712
_______________________________________________
qooxdoo-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel
Reply | Threaded
Open this post in threaded view
|

Re: prevent usage of cached qooxdoo app script if a new version is deployed

Dietrich Streifert
Yes but this is how it should work:

1. Never cache index.html so the browser retreives the content
containing the script tag app_<version>.js.

2. If a new version of the app is build a new file app_<version+1>.js is
created and referenced in the index.html script tag. Both files are
deployed to the server.

3. The User opens the URL and the browser detects the new script tag
where the app file name changed from app_<version>.js to
app_<version+1>.js and loads the new version from the server.


Am 17.01.2013 11:15, schrieb Alexander Voronin:
> Oh, sorry! This should NOT work. You'r setting this pragmas for HTML
> page but not for javascript, which is loading by SEPARATE request! So
> HTML will not be cached, but javascritp will!
>


------------------------------------------------------------------------------
Master Visual Studio, SharePoint, SQL, ASP.NET, C# 2012, HTML5, CSS,
MVC, Windows 8 Apps, JavaScript and much more. Keep your skills current
with LearnDevNow - 3,200 step-by-step video tutorials by Microsoft
MVPs and experts. ON SALE this month only -- learn more at:
http://p.sf.net/sfu/learnmore_122712
_______________________________________________
qooxdoo-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel
Reply | Threaded
Open this post in threaded view
|

Re: prevent usage of cached qooxdoo app script if a new version is deployed

marginal
In this context looks nice, but too complicated. 
I prefere header based solution.


2013/1/17 Dietrich Streifert <[hidden email]>
Yes but this is how it should work:

1. Never cache index.html so the browser retreives the content
containing the script tag app_<version>.js.

2. If a new version of the app is build a new file app_<version+1>.js is
created and referenced in the index.html script tag. Both files are
deployed to the server.

3. The User opens the URL and the browser detects the new script tag
where the app file name changed from app_<version>.js to
app_<version+1>.js and loads the new version from the server.


Am 17.01.2013 11:15, schrieb Alexander Voronin:
> Oh, sorry! This should NOT work. You'r setting this pragmas for HTML
> page but not for javascript, which is loading by SEPARATE request! So
> HTML will not be cached, but javascritp will!
>


------------------------------------------------------------------------------
Master Visual Studio, SharePoint, SQL, ASP.NET, C# 2012, HTML5, CSS,
MVC, Windows 8 Apps, JavaScript and much more. Keep your skills current
with LearnDevNow - 3,200 step-by-step video tutorials by Microsoft
MVPs and experts. ON SALE this month only -- learn more at:
http://p.sf.net/sfu/learnmore_122712
_______________________________________________
qooxdoo-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel



--
когда я опустился на самое дно, снизу мне постучали..

------------------------------------------------------------------------------
Master Visual Studio, SharePoint, SQL, ASP.NET, C# 2012, HTML5, CSS,
MVC, Windows 8 Apps, JavaScript and much more. Keep your skills current
with LearnDevNow - 3,200 step-by-step video tutorials by Microsoft
MVPs and experts. ON SALE this month only -- learn more at:
http://p.sf.net/sfu/learnmore_122712
_______________________________________________
qooxdoo-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel
Reply | Threaded
Open this post in threaded view
|

Re: prevent usage of cached qooxdoo app script if a new version is deployed

Thomas Herchenroeder
In reply to this post by Dietrich Streifert

On 01/17/2013 10:54 AM, Dietrich Streifert wrote:
> Hi Alexander!
>
> Thank you for your answer.
>
> I'm running on apache so this may be a part of the solutions I'm
> searching for.
>
> I WANT the app.js to be cached UNTIL the file version changes.

A canoncial solution would be to do as Alexander suggested and have the
*app.js* as no-cache so any potential change to this file is picked up
immediately. This should be a small overhead if you use the Generator
features so that app.js only contains the loader logic.

All application class code is then in subsequent .js files. These files
are build-dependent, which is reflected by a hash in their names, and
can be cached indefinitely (or for a very long time). If their contents
changes their name will change, which is then reflected in the loader
(which contains a list of their names), and the loader in turn will
request the new files with new names (which have never been cached
before). So automatically only changed application code will be requested.

This approach would give you maximum immediacy of new code, with minimal
download overhead. The HTML page can also be cached indefinitely as its
contents never changes.

If you feel that reloading the loader every time is still to much
network footprint, and want to stick with an HTML-based solution, you'd
need to add a custom job to the Generator's "build" job that essentially
renames the generated loader and inserts the new name into the HTML page
(a couple of lines of code if you do it in Perl or Python). There is
currently no HTML templating support in the Generator.

T.

>
> The html file (index.html) which loads app.js already has in <head>:
>
>     <meta http-equiv="Expires" content="0">
>     <meta http-equiv="cache-control" content="no-cache">
>     <meta http-equiv="Pragma" content="no-cache">
>
> which is I think equivalent to using mod_headers with: Header set Pragma
> "no-cache" and should therefore never get cached by the browser (or am I
> wrong here?).
>
> So opening index.html should reliably indicate to the browser if the url
> of the script tag changed which should cause an uncached load.
>
>
>
> Am 17.01.2013 10:40, schrieb Alexander Voronin:
>> There is another solution. Depending on yours HTTP server you may send
>> header "Cache-Control: no-cache" using special settings.
>> For apache you may use this directives in .htaccess file:
>>
>> <filesMatch ".(js|css)$">
>> FileETag None
>> <ifModule mod_headers.c>
>> Header set Pragma "no-cache"
>> </ifModule>
>> </filesMatch>
>>
>> If you'r using IIS create Web.config with following settings
>> in system.webServer section:
>>
>> <httpProtocol>
>> <customHeaders>
>> <add name="Cache-Control" value="no-cache" />
>> </customHeaders>
>> </httpProtocol>
>>
>
> ------------------------------------------------------------------------------
> Master Visual Studio, SharePoint, SQL, ASP.NET, C# 2012, HTML5, CSS,
> MVC, Windows 8 Apps, JavaScript and much more. Keep your skills current
> with LearnDevNow - 3,200 step-by-step video tutorials by Microsoft
> MVPs and experts. ON SALE this month only -- learn more at:
> http://p.sf.net/sfu/learnmore_122712
> _______________________________________________
> qooxdoo-devel mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel
>
>


------------------------------------------------------------------------------
Master Visual Studio, SharePoint, SQL, ASP.NET, C# 2012, HTML5, CSS,
MVC, Windows 8 Apps, JavaScript and much more. Keep your skills current
with LearnDevNow - 3,200 step-by-step video tutorials by Microsoft
MVPs and experts. ON SALE this month only -- learn more at:
http://p.sf.net/sfu/learnmore_122712
_______________________________________________
qooxdoo-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel
Reply | Threaded
Open this post in threaded view
|

Re: prevent usage of cached qooxdoo app script if a new version is deployed

marv
RE: [qooxdoo-devel] prevent usage of cached qooxdoo app script if a new version is deployed

I think you are looking for 'auto versioning'. Look at this discussion for ins & outs & a nice general solution:

 

http://stackoverflow.com/questions/118884/what-is-an-elegant-way-to-force-browsers-to-reload-cached-css-js-files

 

Hope it helps you.

 

Regards,

Martijn


 

-----Oorspronkelijk bericht-----
Aan: qooxdoo Development <[hidden email]>;
Van: thron7 <[hidden email]>
Verzonden: do 17-01-2013 12:38
Onderwerp: Re: [qooxdoo-devel] prevent usage of cached qooxdoo app script if a new version is deployed

On 01/17/2013 10:54 AM, Dietrich Streifert wrote:
> Hi Alexander!
>
> Thank you for your answer.
>
> I'm running on apache so this may be a part of the solutions I'm
> searching for.
>
> I WANT the app.js to be cached UNTIL the file version changes.

A canoncial solution would be to do as Alexander suggested and have the
*app.js* as no-cache so any potential change to this file is picked up
immediately. This should be a small overhead if you use the Generator
features so that app.js only contains the loader logic.

All application class code is then in subsequent .js files. These files
are build-dependent, which is reflected by a hash in their names, and
can be cached indefinitely (or for a very long time). If their contents
changes their name will change, which is then reflected in the loader
(which contains a list of their names), and the loader in turn will
request the new files with new names (which have never been cached
before). So automatically only changed application code will be requested.

This approach would give you maximum immediacy of new code, with minimal
download overhead. The HTML page can also be cached indefinitely as its
contents never changes.

If you feel that reloading the loader every time is still to much
network footprint, and want to stick with an HTML-based solution, you'd
need to add a custom job to the Generator's "build" job that essentially
renames the generated loader and inserts the new name into the HTML page
(a couple of lines of code if you do it in Perl or Python). There is
currently no HTML templating support in the Generator.

T.

>
> The html file (index.html) which loads app.js already has in <head>:
>
>     <meta http-equiv="Expires" content="0">
>     <meta http-equiv="cache-control" content="no-cache">
>     <meta http-equiv="Pragma" content="no-cache">
>
> which is I think equivalent to using mod_headers with: Header set Pragma
> "no-cache" and should therefore never get cached by the browser (or am I
> wrong here?).
>
> So opening index.html should reliably indicate to the browser if the url
> of the script tag changed which should cause an uncached load.
>
>
>
> Am 17.01.2013 10:40, schrieb Alexander Voronin:
>> There is another solution. Depending on yours HTTP server you may send
>> header "Cache-Control: no-cache" using special settings.
>> For apache you may use this directives in .htaccess file:
>>
>> <filesMatch ".(js|css)$">
>> FileETag None
>> <ifModule mod_headers.c>
>> Header set Pragma "no-cache"
>> </ifModule>
>> </filesMatch>
>>
>> If you'r using IIS create Web.config with following settings
>> in system.webServer section:
>>
>> <httpProtocol>
>> <customHeaders>
>> <add name="Cache-Control" value="no-cache" />
>> </customHeaders>
>> </httpProtocol>
>>
>
> ------------------------------------------------------------------------------
> Master Visual Studio, SharePoint, SQL, ASP.NET, C# 2012, HTML5, CSS,
> MVC, Windows 8 Apps, JavaScript and much more. Keep your skills current
> with LearnDevNow - 3,200 step-by-step video tutorials by Microsoft
> MVPs and experts. ON SALE this month only -- learn more at:
> http://p.sf.net/sfu/learnmore_122712
> _______________________________________________
> qooxdoo-devel mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel
>
>


------------------------------------------------------------------------------
Master Visual Studio, SharePoint, SQL, ASP.NET, C# 2012, HTML5, CSS,
MVC, Windows 8 Apps, JavaScript and much more. Keep your skills current
with LearnDevNow - 3,200 step-by-step video tutorials by Microsoft
MVPs and experts. ON SALE this month only -- learn more at:
http://p.sf.net/sfu/learnmore_122712
_______________________________________________
qooxdoo-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel

------------------------------------------------------------------------------
Master Visual Studio, SharePoint, SQL, ASP.NET, C# 2012, HTML5, CSS,
MVC, Windows 8 Apps, JavaScript and much more. Keep your skills current
with LearnDevNow - 3,200 step-by-step video tutorials by Microsoft
MVPs and experts. ON SALE this month only -- learn more at:
http://p.sf.net/sfu/learnmore_122712
_______________________________________________
qooxdoo-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel
Reply | Threaded
Open this post in threaded view
|

Re: prevent usage of cached qooxdoo app script if a new version is deployed

Dietrich Streifert
In reply to this post by Thomas Herchenroeder
Am 17.01.2013 12:37, schrieb thron7:

> On 01/17/2013 10:54 AM, Dietrich Streifert wrote:
>> Hi Alexander!
>>
>> Thank you for your answer.
>>
>> I'm running on apache so this may be a part of the solutions I'm
>> searching for.
>>
>> I WANT the app.js to be cached UNTIL the file version changes.
> A canoncial solution would be to do as Alexander suggested and have the
> *app.js* as no-cache so any potential change to this file is picked up
> immediately. This should be a small overhead if you use the Generator
> features so that app.js only contains the loader logic.
Thank you for you answer Thomas.

In fact the app.js size is 2.2 MByte and uses the generator but my app
is a really big one.
There are a total of 639 classes in the app containing two (really!)
large forms.

So how do I use the "loader logic"? Do you mean the part loader?


Regards
Dietrich

------------------------------------------------------------------------------
Master Visual Studio, SharePoint, SQL, ASP.NET, C# 2012, HTML5, CSS,
MVC, Windows 8 Apps, JavaScript and much more. Keep your skills current
with LearnDevNow - 3,200 step-by-step video tutorials by Microsoft
MVPs and experts. ON SALE this month only -- learn more at:
http://p.sf.net/sfu/learnmore_122712
_______________________________________________
qooxdoo-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel
Reply | Threaded
Open this post in threaded view
|

Re: prevent usage of cached qooxdoo app script if a new version is deployed

Dietrich Streifert
In reply to this post by marv
Am 17.01.2013 14:36, schrieb Martijn Verbrugh:
RE: [qooxdoo-devel] prevent usage of cached qooxdoo app script if a new version is deployed

I think you are looking for 'auto versioning'. Look at this discussion for ins & outs & a nice general solution:

 

http://stackoverflow.com/questions/118884/what-is-an-elegant-way-to-force-browsers-to-reload-cached-css-js-files

 

Hope it helps you.

 

Regards,

Martijn


Thank you Martin. I'll have a look into it.

Regards.


------------------------------------------------------------------------------
Master Visual Studio, SharePoint, SQL, ASP.NET, C# 2012, HTML5, CSS,
MVC, Windows 8 Apps, JavaScript and much more. Keep your skills current
with LearnDevNow - 3,200 step-by-step video tutorials by Microsoft
MVPs and experts. ON SALE this month only -- learn more at:
http://p.sf.net/sfu/learnmore_122712
_______________________________________________
qooxdoo-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel
Reply | Threaded
Open this post in threaded view
|

Re: prevent usage of cached qooxdoo app script if a new version is deployed

Thomas Herchenroeder
In reply to this post by Dietrich Streifert

On 01/17/2013 02:37 PM, Dietrich Streifert wrote:

>> A canoncial solution would be to do as Alexander suggested and have the
>> *app.js* as no-cache so any potential change to this file is picked up
>> immediately. This should be a small overhead if you use the Generator
>> features so that app.js only contains the loader logic.
> Thank you for you answer Thomas.
>
> In fact the app.js size is 2.2 MByte and uses the generator but my app
> is a really big one.
> There are a total of 639 classes in the app containing two (really!)
> large forms.
>
> So how do I use the "loader logic"? Do you mean the part loader?

Yes, quite, but there is no need to use any real parts. You can just
split the loader from the application code. In your config.json use

"build-script" : {
   "packages" : {
     "parts" : {
        "boot" : { "include" : [<your normal include list>] },
       "separate-loader" : true
     }
   }
}

This defines a (trivial) one-part app for the build version, with just
the minimal "boot" part, but also splits the loader from the app code.
And there is no need to instrument your code with
qx.io.PartLoader.require calls, as the boot part is loaded anyway. (For
a big app, using actual parts beyond "boot" might be a good idea as well.)

T.


------------------------------------------------------------------------------
Master Visual Studio, SharePoint, SQL, ASP.NET, C# 2012, HTML5, CSS,
MVC, Windows 8 Apps, JavaScript and much more. Keep your skills current
with LearnDevNow - 3,200 step-by-step video tutorials by Microsoft
MVPs and experts. ON SALE this month only -- learn more at:
http://p.sf.net/sfu/learnmore_122712
_______________________________________________
qooxdoo-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel
Reply | Threaded
Open this post in threaded view
|

Re: prevent usage of cached qooxdoo app script if a new version is deployed

Dietrich Streifert
Am 17.01.2013 15:40, schrieb thron7:

> Yes, quite, but there is no need to use any real parts. You can just
> split the loader from the application code. In your config.json use
>
> "build-script" : {
>     "packages" : {
>       "parts" : {
>          "boot" : { "include" : [<your normal include list>] },
>         "separate-loader" : true
>       }
>     }
> }
>
> This defines a (trivial) one-part app for the build version, with just
> the minimal "boot" part, but also splits the loader from the app code.
> And there is no need to instrument your code with
> qx.io.PartLoader.require calls, as the boot part is loaded anyway. (For
> a big app, using actual parts beyond "boot" might be a good idea as well.)
>
> T.
>
Thank you Thomas, but what do you mean with [<your normal include list>]?

using

     "build-script" :
     {
       "packages" : {
         "parts" : {
           "boot" : {
             "include" : ["${APPLICATION}.*"]
           },
           "separate-loader" : true
         }
       }
     }

gives a stack trace in generator.py

Regards
Dietrich


------------------------------------------------------------------------------
Master Visual Studio, SharePoint, SQL, ASP.NET, C# 2012, HTML5, CSS,
MVC, Windows 8 Apps, JavaScript and much more. Keep your skills current
with LearnDevNow - 3,200 step-by-step video tutorials by Microsoft
MVPs and experts. ON SALE this month only -- learn more at:
http://p.sf.net/sfu/learnmore_122712
_______________________________________________
qooxdoo-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel
Reply | Threaded
Open this post in threaded view
|

Re: prevent usage of cached qooxdoo app script if a new version is deployed

Thomas Herchenroeder

On 01/17/2013 04:26 PM, Dietrich Streifert wrote:

> Thank you Thomas, but what do you mean with [<your normal include list>]?
>
> using
>
>       "build-script" :
>       {
>         "packages" : {
>           "parts" : {
>             "boot" : {
>               "include" : ["${APPLICATION}.*"]
>             },
>             "separate-loader" : true
>           }
>         }
>       }
>
> gives a stack trace in generator.py

The "normal" include list for a compile job is
["${APPLICATION_MAIN_CLASS}", "${QXTHEME}"]. If you haven't overridden
the "include" key in any of your source or build jobs, you can use this
value literally.

Ah, and I've added "separate-loader" at the wrong level, sorry (that's
probably the stack trace). So the entire entry should be:

     "build-script" : {
       "packages" : {
         "parts" : {
           "boot" : {
             "include" : ["${APPLICATION_MAIN_CLASS}", "${QXTHEME}"]
           }
         }
         ,"separate-loader" : true
       }
     }


T.


------------------------------------------------------------------------------
Master Visual Studio, SharePoint, SQL, ASP.NET, C# 2012, HTML5, CSS,
MVC, Windows 8 Apps, JavaScript and much more. Keep your skills current
with LearnDevNow - 3,200 step-by-step video tutorials by Microsoft
MVPs and experts. ON SALE this month only -- learn more at:
http://p.sf.net/sfu/learnmore_122712
_______________________________________________
qooxdoo-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel
Reply | Threaded
Open this post in threaded view
|

Re: prevent usage of cached qooxdoo app script if a new version is deployed

Dietrich Streifert
Thank you Thomas.

I'm now having app.js (the loader) and app_<somechecksum>.js with the rest.

So I would inhibit caching for index.html and app.js while
app_<somechecksum>.js is allowed to be cached, because, if necessary,
app.js (which is uncached) then loads a new app_<someotherchecksum>.js
if the name has changed.

Right?

Regards
Dietrich

Am 17.01.2013 17:16, schrieb thron7:

> On 01/17/2013 04:26 PM, Dietrich Streifert wrote:
>
>> Thank you Thomas, but what do you mean with [<your normal include list>]?
>>
>> using
>>
>>        "build-script" :
>>        {
>>          "packages" : {
>>            "parts" : {
>>              "boot" : {
>>                "include" : ["${APPLICATION}.*"]
>>              },
>>              "separate-loader" : true
>>            }
>>          }
>>        }
>>
>> gives a stack trace in generator.py
> The "normal" include list for a compile job is
> ["${APPLICATION_MAIN_CLASS}", "${QXTHEME}"]. If you haven't overridden
> the "include" key in any of your source or build jobs, you can use this
> value literally.
>
> Ah, and I've added "separate-loader" at the wrong level, sorry (that's
> probably the stack trace). So the entire entry should be:
>
>       "build-script" : {
>         "packages" : {
>           "parts" : {
>             "boot" : {
>               "include" : ["${APPLICATION_MAIN_CLASS}", "${QXTHEME}"]
>             }
>           }
>           ,"separate-loader" : true
>         }
>       }
>
>
> T.
>
>
> ------------------------------------------------------------------------------
> Master Visual Studio, SharePoint, SQL, ASP.NET, C# 2012, HTML5, CSS,
> MVC, Windows 8 Apps, JavaScript and much more. Keep your skills current
> with LearnDevNow - 3,200 step-by-step video tutorials by Microsoft
> MVPs and experts. ON SALE this month only -- learn more at:
> http://p.sf.net/sfu/learnmore_122712
> _______________________________________________
> qooxdoo-devel mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel


------------------------------------------------------------------------------
Master HTML5, CSS3, ASP.NET, MVC, AJAX, Knockout.js, Web API and
much more. Get web development skills now with LearnDevNow -
350+ hours of step-by-step video tutorials by Microsoft MVPs and experts.
SALE $99.99 this month only -- learn more at:
http://p.sf.net/sfu/learnmore_122812
_______________________________________________
qooxdoo-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel
Reply | Threaded
Open this post in threaded view
|

Re: prevent usage of cached qooxdoo app script if a new version is deployed

Thomas Herchenroeder

On 01/18/2013 02:42 PM, Dietrich Streifert wrote:

> Thank you Thomas.
>
> I'm now having app.js (the loader) and app_<somechecksum>.js with the rest.
>
> So I would inhibit caching for index.html and app.js while
> app_<somechecksum>.js is allowed to be cached, because, if necessary,
> app.js (which is uncached) then loads a new app_<someotherchecksum>.js
> if the name has changed.
>
> Right?

Basically yes. For a typical skeleton app index.html could also be
cached (as the reference to app.js doesn't change).

The only resource that has to be refreshed everytime is app.js itself.

T.


------------------------------------------------------------------------------
Master HTML5, CSS3, ASP.NET, MVC, AJAX, Knockout.js, Web API and
much more. Get web development skills now with LearnDevNow -
350+ hours of step-by-step video tutorials by Microsoft MVPs and experts.
SALE $99.99 this month only -- learn more at:
http://p.sf.net/sfu/learnmore_122812
_______________________________________________
qooxdoo-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel