Templates files and javascript not getting updated

Bug #691314 reported by jsherk
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
PHPDevShell
Invalid
Undecided
Unassigned

Bug Description

v3beta4 is still showing the same issues with earlier betas.

When I upload a new template file, the new file is not used right away. I almost always have to upload the file twice to get the new template to work. I do not have an issue with controller or models files... uploading them one time always works.

Also, the other issue I have noticed is with Javascript. I use this in the controller file:
$this->template->addJsFileToHead('plugins/myPlugin/includes/myfile.js');

When I modify the js file, the changes almost never take effect, even when I have also modified the template file. I have to actually save the js file with a new name and change the addJsFileToHead to the new name, or the new js will not take effect.
If I delete the js file first from the server and then load the page, and then upload the js file again with the same name and then load the page a second time, then old js will still appear on the page, not the new.

My single.site.config.php settings are as follows:
$configuration['production'] = false;
$configuration['cache_refresh_intervals'] = 2;
$configuration['views_cache_lifetime'] = 2;
$configuration['memcache_timeout'] = 2;

Revision history for this message
jsherk (jeff-forerunnertv) wrote :

I may have found the issue that is causing this problem...

I am using WinSCP to upload/download files, and there is a setting called "Preserve Timestamp" which was enabled, so everytime I modified a file and saved it on my computer, the CREATED DATE did NOT change, and then when I uploaded it to the server with WinSCP, it keep the original created date and would not modify the timestamp.

I have unchecked this option, so now everytime a file is uploaded, it gets a new timestamp. So, assuming that phpds looks at timestamps to determine if a file has been modified or not, this should solve the problem.

Setting is located here in WinSCP:
Preferences > Preferences > Transfer > Common Options:Preserve Timestamp

I will report back if I find the problem still exists.

Thanks

Revision history for this message
jsherk (jeff-forerunnertv) wrote :

Ok, I have confirmed that this has NOT solved the problem...

I upload a modified template file, and I reload the page in Firefox but the change does not take effect. I even checked the file on the server and confirmed that it have a new timestamp on it!

Not sure what is going with all this!

Revision history for this message
jsherk (jeff-forerunnertv) wrote :

I also just confirmed that the problem exists with Chrome as well as FIrefox.

Revision history for this message
Greg (gregfr) wrote :

Did you try a hard refresh? maybe it's the browser cache...

Revision history for this message
jsherk (jeff-forerunnertv) wrote :

Yes, I tried that as well and did not solve problem.

However I think I found the problem, and it does not appear to be a phpds issue...

I just ran some tests and found the following:
#1 - Modify and save file on my local machine.
#2 - Upload modified file to server.
#3 - Confirm that uploaded file has new timestamp.
#4 - Download the file from server.
#5 - The downloaded file is NOT the same as the original file that was uploaded.

So the issue appears to somehow be related to either a server side issue or an ftp issue.

I will continue to investigate and report back when I get more details.

Revision history for this message
Greg (gregfr) wrote :

Maybe you can contact your hosting provider and ask them about the server cache

Revision history for this message
Gani Utomo (ganiutomo) wrote : Re: [Phpdevshell] [Bug 691314] Re: Templates files and javascript notgetting updated

This happen usually on a framework that used any kind of caching solution. Try this:
1. Disable any kind of caching on development. Either default PHPDS caching mechanism, memcache, etc.
2. Sometime web server is configured to cache its output. You can use .htaccess to force web server from caching the result.
3. Don't use IE in development.
Sent from my AXIS Worry Free BlackBerry® smartphone

-----Original Message-----
From: jsherk <email address hidden>
Sender: <email address hidden>
Date: Fri, 17 Dec 2010 16:40:37
To: <email address hidden>
Reply-To: Bug 691314 <email address hidden>
Subject: [Phpdevshell] [Bug 691314] Re: Templates files and javascript not
 getting updated

Yes, I tried that as well and did not solve problem.

However I think I found the problem, and it does not appear to be a
phpds issue...

I just ran some tests and found the following:
#1 - Modify and save file on my local machine.
#2 - Upload modified file to server.
#3 - Confirm that uploaded file has new timestamp.
#4 - Download the file from server.
#5 - The downloaded file is NOT the same as the original file that was uploaded.

So the issue appears to somehow be related to either a server side issue
or an ftp issue.

I will continue to investigate and report back when I get more details.

--
You received this bug notification because you are a member of
PHPDevShell, which is subscribed to PHPDevShell.
https://bugs.launchpad.net/bugs/691314

Title:
  Templates files and javascript not getting updated

Status in Open Source PHP RAD Framework with UI.:
  New

Bug description:
  v3beta4 is still showing the same issues with earlier betas.

When I upload a new template file, the new file is not used right away. I almost always have to upload the file twice to get the new template to work. I do not have an issue with controller or models files... uploading them one time always works.

Also, the other issue I have noticed is with Javascript. I use this in the controller file:
$this->template->addJsFileToHead('plugins/myPlugin/includes/myfile.js');

When I modify the js file, the changes almost never take effect, even when I have also modified the template file. I have to actually save the js file with a new name and change the addJsFileToHead to the new name, or the new js will not take effect.
If I delete the js file first from the server and then load the page, and then upload the js file again with the same name and then load the page a second time, then old js will still appear on the page, not the new.

My single.site.config.php settings are as follows:
$configuration['production'] = false;
$configuration['cache_refresh_intervals'] = 2;
$configuration['views_cache_lifetime'] = 2;
$configuration['memcache_timeout'] = 2;

_______________________________________________
Mailing list: https://launchpad.net/~phpdevshell
Post to : <email address hidden>
Unsubscribe : https://launchpad.net/~phpdevshell
More help : https://help.launchpad.net/ListHelp

Revision history for this message
Gani Utomo (ganiutomo) wrote :

If u were using hosting solution not personal development PC. There's a big chance the problem is in the server configuration. Hosting solution use some kind of caching to minimize bandwidth usage.
Sent from my AXIS Worry Free BlackBerry® smartphone

-----Original Message-----
From: Greg <email address hidden>
Sender: <email address hidden>
Date: Fri, 17 Dec 2010 16:52:22
To: <email address hidden>
Reply-To: Bug 691314 <email address hidden>
Subject: [Phpdevshell] [Bug 691314] Re: Templates files and javascript not
 getting updated

Maybe you can contact your hosting provider and ask them about the
server cache

--
You received this bug notification because you are a member of
PHPDevShell, which is subscribed to PHPDevShell.
https://bugs.launchpad.net/bugs/691314

Title:
  Templates files and javascript not getting updated

Status in Open Source PHP RAD Framework with UI.:
  New

Bug description:
  v3beta4 is still showing the same issues with earlier betas.

When I upload a new template file, the new file is not used right away. I almost always have to upload the file twice to get the new template to work. I do not have an issue with controller or models files... uploading them one time always works.

Also, the other issue I have noticed is with Javascript. I use this in the controller file:
$this->template->addJsFileToHead('plugins/myPlugin/includes/myfile.js');

When I modify the js file, the changes almost never take effect, even when I have also modified the template file. I have to actually save the js file with a new name and change the addJsFileToHead to the new name, or the new js will not take effect.
If I delete the js file first from the server and then load the page, and then upload the js file again with the same name and then load the page a second time, then old js will still appear on the page, not the new.

My single.site.config.php settings are as follows:
$configuration['production'] = false;
$configuration['cache_refresh_intervals'] = 2;
$configuration['views_cache_lifetime'] = 2;
$configuration['memcache_timeout'] = 2;

_______________________________________________
Mailing list: https://launchpad.net/~phpdevshell
Post to : <email address hidden>
Unsubscribe : https://launchpad.net/~phpdevshell
More help : https://help.launchpad.net/ListHelp

Revision history for this message
jsherk (jeff-forerunnertv) wrote :

I may have found the problem... if this does not work, then I will look into the server cache issue, although I do not think that is the problem because it is only the .js and .tpl files that I have an issue with.

So what I think is the problem now, is that WinSCP (like most FTP programs) uses an automatic mode to determine whether a file should be uploaded as ascii or binary. Both the .js and .tpl files were being uploaded as binary. I changed the settings to upload them as ascii now.

I will again report back as to whether this solves the issue or not. If it does not, then I will have to look at server side issues as mentioned above.

Revision history for this message
jsherk (jeff-forerunnertv) wrote :

Ok, yes it appears the problem was .js and .tpl files were being uploaded as binary and this was somehow corrupting them sometimes.

Changing them to ascii uploads seems to have eliminated the problem!

Thanks

Revision history for this message
TitanKing (titan-phpdevshell) wrote :

I recommend using FileZilla with automatic mode selection. This will solve most of the uploading problems.

Changed in phpdevshell:
status: New → Invalid
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.